Ejemplo n.º 1
0
 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'}}})
Ejemplo n.º 2
0
 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'}}})
Ejemplo n.º 3
0
 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'
                 }
             }
         })
Ejemplo n.º 4
0
 def test_two_setter(self):
     self.assertEqual(
         Setter.setter(self.settings, 'deep', 'tree', 'nesting'),
         ({
             'fish': 'food',
             'nesting': 'egg'
         }, 'nesting'))
Ejemplo n.º 5
0
 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'
                 }
             }
         })
Ejemplo n.º 6
0
 def test_two_setter(self):
     self.assertEqual(
         Setter.setter(self.settings, 'deep', 'tree', 'nesting'),
         ({'fish': 'food', 'nesting': 'egg'}, 'nesting'))
Ejemplo n.º 7
0
 def test_simple_setter(self):
     self.assertEqual(Setter.setter(self.settings, 'hello'),
                      (self.settings, 'hello'))
Ejemplo n.º 8
0
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
Ejemplo n.º 9
0
 def test_simple_setter(self):
   self.assertEqual(Setter.setter(self.config, 'hello'),
                    (self.config, 'hello'))
Ejemplo n.º 10
0
 def test_simple_setter(self):
     self.assertEqual(Setter.setter(self.settings, 'hello'),
                      (self.settings, 'hello'))