Example #1
0
 def test_render(self):
     foo = conf_f.EnvironmentConfig('foo')
     expected = {'ke1': 'value1', 'key2': 'value2'}
     foo._config_dict = expected
     actual = foo.render()
     bar = conf_f.EnvironmentConfig('bar')
     bar.parse(actual)
     self.assertEqual(expected, bar._config_dict)
Example #2
0
 def test_render_extra_properties(self):
     foo = conf_f.EnvironmentConfig('foo')
     foo.parse(self.content)
     foo.add_property('key3', 'value3')
     foo_content = foo.render()
     bar = conf_f.EnvironmentConfig('bar')
     bar.parse(foo_content)
     expected = {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}
     self.assertEqual(expected, bar._config_dict)
Example #3
0
 def test_add_property(self):
     foo = conf_f.EnvironmentConfig('foo')
     self.assertEqual({}, foo._config_dict)
     foo.add_property('key1', 'value1')
     self.assertEqual({'key1': 'value1'}, foo._config_dict)
     foo.add_property('key2', 'value2')
     expected = {'key1': 'value1', 'key2': 'value2'}
     self.assertEqual(expected, foo._config_dict)
Example #4
0
 def test_get_config_value(self):
     foo = conf_f.EnvironmentConfig('foo')
     foo._config_dict = {'foo': 'bar'}
     self.assertEqual('bar', foo._get_config_value('foo'))
     self.assertIsNone(foo._get_config_value('bar'))
Example #5
0
 def test_parse(self):
     foo = conf_f.EnvironmentConfig('foo')
     foo.parse(self.content)
     expected = {'key1': 'value1', 'key2': 'value2'}
     self.assertEqual(expected, foo._config_dict)
Example #6
0
 def test_remote_path(self):
     foo = conf_f.EnvironmentConfig('foo')
     foo.remote_path = '/bar'
     self.assertEqual('/bar/foo', foo.remote_path)