예제 #1
0
 def test_update_with_dict_allowed_keys(self):
     config = Config({'VAR1': 'ORIGINAL'})
     config.update_with_object(SOME_DICT, allowed_keys=['VAR1'])
     self.assertEqual(config, {'VAR1': 'val1'})
예제 #2
0
 def test_update_with_dict(self):
     config = Config()
     config.update_with_object(SOME_DICT)
     self.assertEqual(config, {'VAR1': 'val1', 'VAR2': 'val2'})
예제 #3
0
 def test_update_with_dict_new_keys(self):
     config = Config({'VAR1': 'ORIGINAL'})
     config.update_with_object(SOME_DICT, only_new_keys=True)
     self.assertEqual(config, {'VAR1': 'ORIGINAL', 'VAR2': 'val2'})
예제 #4
0
 def test_update_with_object_new_keys(self):
     config = Config({'VAR1': 'ORIGINAL'})
     obj = SomeSettings()
     config.update_with_object(obj, only_new_keys=True)
     self.assertEqual(config, {'VAR1': 'ORIGINAL', 'VAR2': 'val2'})
예제 #5
0
 def test_update_with_object_allowed_keys(self):
     config = Config({'VAR1': 'ORIGINAL'})
     obj = SomeSettings()
     config.update_with_object(obj, allowed_keys=['VAR1'])
     self.assertEqual(config, {'VAR1': 'val1'})
예제 #6
0
 def test_update_with_dict_allowed_keys(self):
     config = Config({'VAR1': 'ORIGINAL'})
     config.update_with_object(SOME_DICT, allowed_keys=['VAR1'])
     self.assertEqual(config, {'VAR1': 'val1'})
예제 #7
0
 def test_update_with_object(self):
     config = Config()
     obj = SomeSettings()
     config.update_with_object(obj)
     self.assertEqual(config, {'VAR1': 'val1', 'VAR2': 'val2'})
예제 #8
0
 def test_update_with_dict_new_keys(self):
     config = Config({'VAR1': 'ORIGINAL'})
     config.update_with_object(SOME_DICT, only_new_keys=True)
     self.assertEqual(config, {'VAR1': 'ORIGINAL', 'VAR2': 'val2'})
예제 #9
0
 def test_update_with_dict(self):
     config = Config()
     config.update_with_object(SOME_DICT)
     self.assertEqual(config, {'VAR1': 'val1', 'VAR2': 'val2'})
예제 #10
0
 def test_update_with_object_allowed_keys(self):
     config = Config({'VAR1': 'ORIGINAL'})
     obj = SomeSettings()
     config.update_with_object(obj, allowed_keys=['VAR1'])
     self.assertEqual(config, {'VAR1': 'val1'})
예제 #11
0
 def test_update_with_object_new_keys(self):
     config = Config({'VAR1': 'ORIGINAL'})
     obj = SomeSettings()
     config.update_with_object(obj, only_new_keys=True)
     self.assertEqual(config, {'VAR1': 'ORIGINAL', 'VAR2': 'val2'})
예제 #12
0
 def test_update_with_object(self):
     config = Config()
     obj = SomeSettings()
     config.update_with_object(obj)
     self.assertEqual(config, {'VAR1': 'val1', 'VAR2': 'val2'})