def test_replace_dict(self): actual = self._orig() merge_dict(path_to_dict('log.file', 'disable'), actual) expected = self._orig() expected['log']['file'] = 'disable' self.assertEqual(actual, expected, "file dict not overwritten")
def test_path_to_dict(self): d = path_to_dict('a.b.c', 'd') self.assertEqual(d, {'a': {'b': {'c': 'd'}}}, 'wrong dictionary')
def test_replace_leaf_entry(self): actual = self._orig() merge_dict(path_to_dict('log.file.level', 'error'), actual) expected = self._orig() expected['log']['file']['level'] = 'error' self.assertEqual(actual, expected, "level not overwritten")