summaryrefslogtreecommitdiff
path: root/tests/parsing.py
blob: 185cde93cf53511d1096bb0e40ed02c450756605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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.')