def test_apply_list(self): Setter.apply_list(self.settings, self.add_suffix, ['hello'], ['deep', 'tree', 'fish']) self.assertEqual( self.settings, {'hello': 'world.end', 'deep': {'tree': {'fish': 'food.end', 'nesting': 'egg'}}})
def test_apply_dict(self): Setter.apply_dict(self.config, self.add_suffix, {'hello': True, 'deep': {'tree': {'fish': True}}}) self.assertEqual(self.config, {'hello': 'world.end', 'deep': {'tree': {'fish': 'food.end', 'nesting': 'egg'}}})
def test_apply_list(self): Setter.apply_list(self.settings, self.add_suffix, ['hello'], ['deep', 'tree', 'fish']) self.assertEqual( self.settings, { 'hello': 'world.end', 'deep': { 'tree': { 'fish': 'food.end', 'nesting': 'egg' } } })
def test_two_setter(self): self.assertEqual( Setter.setter(self.settings, 'deep', 'tree', 'nesting'), ({ 'fish': 'food', 'nesting': 'egg' }, 'nesting'))
def test_apply_dict(self): Setter.apply_dict(self.settings, self.add_suffix, { 'hello': True, 'deep': { 'tree': { 'fish': True } } }) self.assertEqual( self.settings, { 'hello': 'world.end', 'deep': { 'tree': { 'fish': 'food.end', 'nesting': 'egg' } } })
def test_two_setter(self): self.assertEqual( Setter.setter(self.settings, 'deep', 'tree', 'nesting'), ({'fish': 'food', 'nesting': 'egg'}, 'nesting'))
def test_simple_setter(self): self.assertEqual(Setter.setter(self.settings, 'hello'), (self.settings, 'hello'))
def evaluate_config(): config = copy.deepcopy(Config.get_config()) Setter.apply_apply_list(config, Expression.convert, *UNIT_ADDRESSES) Setter.apply_list(config, ColorTable.to_color, *COLOR_ADDRESSES) return config
def test_simple_setter(self): self.assertEqual(Setter.setter(self.config, 'hello'), (self.config, 'hello'))