From 7afac3b1f9fb29bb6e68f5ebe8782488b6be4d98 Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 23 Sep 2025 11:05:20 -0400 Subject: Start tests, fix some bugs --- tests/parsing.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/parsing.py (limited to 'tests/parsing.py') diff --git a/tests/parsing.py b/tests/parsing.py new file mode 100644 index 0000000..185cde9 --- /dev/null +++ b/tests/parsing.py @@ -0,0 +1,16 @@ +import pom_parser +import unittest + +def test_path(tester: unittest.TestCase, flat_path: str) -> None: + conf_path = flat_path.replace('.flat.pom', '.pom') + conf = pom_parser.load_path(conf_path) + flat = pom_parser.load_path(flat_path) + conf_items = {} + for item in conf.items(): + tester.assertTrue(flat.has(item.key), f'{conf_path} has key {item.key} but {flat_path} does not') + conf_items[item.key] = item + for item in flat.items(): + tester.assertTrue(conf.has(item.key), f'{flat_path} has key {item.key} but {conf_path} does not') + conf_item = conf_items[item.key] + tester.assertEqual(conf_item.value, item.value, f'Values for key {item.key} do not match.') + -- cgit v1.2.3