Example #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'}}})
Example #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'}}})
Example #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'
                 }
             }
         })
Example #4
0
 def test_two_setter(self):
     self.assertEqual(
         Setter.setter(self.settings, 'deep', 'tree', 'nesting'),
         ({
             'fish': 'food',
             'nesting': 'egg'
         }, 'nesting'))
Example #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'
                 }
             }
         })
Example #6
0
 def test_two_setter(self):
     self.assertEqual(
         Setter.setter(self.settings, 'deep', 'tree', 'nesting'),
         ({'fish': 'food', 'nesting': 'egg'}, 'nesting'))
Example #7
0
 def test_simple_setter(self):
     self.assertEqual(Setter.setter(self.settings, 'hello'),
                      (self.settings, 'hello'))
Example #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
Example #9
0
 def test_simple_setter(self):
   self.assertEqual(Setter.setter(self.config, 'hello'),
                    (self.config, 'hello'))
Example #10
0
 def test_simple_setter(self):
     self.assertEqual(Setter.setter(self.settings, 'hello'),
                      (self.settings, 'hello'))