From d286c4e6c7462d22274bf9748042f219b6052000 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sun, 7 Jul 2024 22:11:40 -0700 Subject: [PATCH] Implemented some more tests --- tests/__init__.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/__init__.py b/tests/__init__.py index 4d0bf05..927dce6 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -7,7 +7,7 @@ from typing import cast from mfbatch.commands import BatchfileParser -class CommandTests(unittest.TestCase): +class BatchfileParserTests(unittest.TestCase): """ Tests the BatchfileParser class """ @@ -47,6 +47,17 @@ class CommandTests(unittest.TestCase): def test_setp(self): "Test setp command" + self.command_parser.set(['VAL', 'ABC123']) + self.command_parser.setp(['DONE', 'VAL', r"([A-Z]+)123", r"X\1"]) + self.command_parser.eval("./testfile.flac", lineno=1, + interactive=False) + + self.assertTrue(cast(MagicMock, + self.command_parser.write_metadata_f).called) + self.assertEqual(cast(MagicMock, + self.command_parser.write_metadata_f).call_args.args, + ("./testfile.flac", {'VAL': 'ABC123', 'DONE': 'XABC'})) + def test_eval(self): "Test eval"