def test_convert_leaves_to_config_values_0(self):
        source = {
            Config.TSSC_CONFIG_KEY: {
                'step-foo': [{
                    'implementer': 'foo1',
                    'config': {
                        'test1': 'foo'
                    }
                }]
            }
        }

        ConfigValue.convert_leaves_to_config_values(
            values=source[Config.TSSC_CONFIG_KEY],
            parent_source=source,
            path_parts=[Config.TSSC_CONFIG_KEY])

        expected = {
            Config.TSSC_CONFIG_KEY: {
                'step-foo': [{
                    'implementer': ConfigValue('foo1', None, None),
                    'config': {
                        'test1': ConfigValue('foo', None, None)
                    }
                }]
            }
        }

        self.assertEqual(source, expected)
    def test_value_path_given_no_inital_value_path_parts(self):
        source = {
            Config.TSSC_CONFIG_KEY: {
                'step-foo': [{
                    'implementer': 'foo1',
                    'config': {
                        'test1': 'foo'
                    }
                }]
            }
        }

        ConfigValue.convert_leaves_to_config_values(values=source,
                                                    parent_source=source)

        self.assertEqual(
            source[Config.TSSC_CONFIG_KEY]['step-foo'][0]['config']
            ['test1'].path_parts,
            ['tssc-config', 'step-foo', 0, 'config', 'test1'])
    def test__repr__(self):
        source = {
            Config.TSSC_CONFIG_KEY: {
                'step-foo': [{
                    'implementer': 'foo1',
                    'config': {
                        'test1': 'foo'
                    }
                }]
            }
        }

        ConfigValue.convert_leaves_to_config_values(
            values=source[Config.TSSC_CONFIG_KEY],
            parent_source=source,
            path_parts=[Config.TSSC_CONFIG_KEY])

        self.assertEqual(
            str(source[Config.TSSC_CONFIG_KEY]['step-foo'][0]['config']
                ['test1']),
            "ConfigValue(value=foo, value_path='['tssc-config', 'step-foo', 0, 'config', 'test1']')"
        )