Пример #1
0
 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")
Пример #2
0
 def test_path_to_dict(self):
     d = path_to_dict('a.b.c', 'd')
     self.assertEqual(d, {'a': {'b': {'c': 'd'}}}, 'wrong dictionary')
Пример #3
0
 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")