Example #1
0
 def test_ref_path_container_error(self):
     parent = Config(Schema(key='root'))
     child = Config(Schema(key='child'), parent=parent)
     child._container = MagicMock()
     child._container._get_item_position = MagicMock(
         side_effect=ValueError())
     assert child._ref_path == 'root.child'
Example #2
0
 def test_ref_path_container(self):
     parent = Config(Schema(key='root'))
     child = Config(Schema(key='child'), parent=parent)
     child._container = MagicMock()
     child._container._get_item_position = MagicMock()
     child._container._get_item_position.return_value = '1'
     assert child._ref_path == 'root.child[1]'
     child._container._get_item_position.assert_called_once_with(child)