(self)
| 219 | self.assertEqual(str(item), str({"key": 1, "value1": 2, "value2": 2, "value3": [3, 4, 4, 105]})) |
| 220 | |
| 221 | def test_macro_replace(self): |
| 222 | with tempfile.TemporaryDirectory() as tempdir: |
| 223 | another_file = os.path.join(tempdir, "another.json") |
| 224 | ConfigParser.export_config_file(config={"E": 4}, filepath=another_file) |
| 225 | # test macro with id, relative id, and macro in another file |
| 226 | config = {"A": {"B": 1, "C": 2}, "D": [3, "%A#B", "%#0", f"%{another_file}#E"]} |
| 227 | parser = ConfigParser(config=config) |
| 228 | parser.resolve_macro_and_relative_ids() |
| 229 | self.assertEqual(str(parser.get()), str({"A": {"B": 1, "C": 2}, "D": [3, 1, 3, 4]})) |
| 230 | |
| 231 | @parameterized.expand([TEST_CASE_4]) |
| 232 | def test_allow_missing_reference(self, config): |
nothing calls this directly
no test coverage detected