Пример #1
0
    def test_get_obj_path_missing(self):
        # Arrange
        obj = {
            'whatever': 'no',
        }

        path = ('test1', )

        expected_props = None

        # Act
        actual_props = util.get_obj_value(obj, path)

        # Assert
        self.assertEqual(expected_props, actual_props)
Пример #2
0
    def test_get_obj_path(self):
        # Arrange
        obj = {
            'whatever': 'no',
            'test1': {
                'garbage': 'there is some stuff here already',
                'test2': ['something']
            }
        }

        path = ('test1', 'test2')

        expected_props = ['something']

        # Act
        actual_props = util.get_obj_value(obj, path)

        # Assert
        self.assertEqual(expected_props, actual_props)