def test_valid_and_invalid_actions(self):
     self.section.append(Setting(
         'default_actions',
         'MyBear: INVALID_action, ValidBear: ApplyPatchAction, XBear: ABC'))
     self.assertEqual(get_default_actions(self.section),
                      ({'ValidBear': ApplyPatchAction},
                       {'MyBear': 'INVALID_action', 'XBear': 'ABC'}))
 def test_valid_and_invalid_actions(self):
     self.section.append(Setting(
         "default_actions",
         "MyBear: INVALID_action, ValidBear: ApplyPatchAction, XBear: ABC"))
     self.assertEqual(get_default_actions(self.section),
                      ({"ValidBear": ApplyPatchAction},
                       {"MyBear": "INVALID_action", "XBear": "ABC"}))
Exemple #3
0
 def test_valid_and_invalid_actions(self):
     self.section.append(Setting(
         'default_actions',
         'MyBear: INVALID_action, ValidBear: ApplyPatchAction, XBear: ABC'))
     self.assertEqual(get_default_actions(self.section),
                      ({'ValidBear': ApplyPatchAction},
                       {'MyBear': 'INVALID_action', 'XBear': 'ABC'}))
Exemple #4
0
 def test_valid_and_invalid_actions(self):
     self.section.append(Setting(
         "default_actions",
         "MyBear: INVALID_action, ValidBear: ApplyPatchAction, XBear: ABC"))
     self.assertEqual(get_default_actions(self.section),
                      ({"ValidBear": ApplyPatchAction},
                       {"MyBear": "INVALID_action", "XBear": "ABC"}))
 def test_only_valid_actions(self):
     self.section.append(Setting(
         "default_actions",
         "MyBear: PrintDebugMessageAction, ValidBear: ApplyPatchAction"))
     self.assertEqual(
         get_default_actions(self.section),
         ({"MyBear": PrintDebugMessageAction,
           "ValidBear": ApplyPatchAction},
          {}))
Exemple #6
0
 def test_only_valid_actions(self):
     self.section.append(Setting(
         'default_actions',
         'MyBear: PrintDebugMessageAction, ValidBear: ApplyPatchAction'))
     self.assertEqual(
         get_default_actions(self.section),
         ({'MyBear': PrintDebugMessageAction,
           'ValidBear': ApplyPatchAction},
          {}))
 def test_only_valid_actions(self):
     self.section.append(Setting(
         'default_actions',
         'MyBear: PrintDebugMessageAction, ValidBear: ApplyPatchAction'))
     self.assertEqual(
         get_default_actions(self.section),
         ({'MyBear': PrintDebugMessageAction,
           'ValidBear': ApplyPatchAction},
          {}))
Exemple #8
0
 def test_only_valid_actions(self):
     self.section.append(Setting(
         "default_actions",
         "MyBear: PrintDebugMessageAction, ValidBear: ApplyPatchAction"))
     self.assertEqual(
         get_default_actions(self.section),
         ({"MyBear": PrintDebugMessageAction,
           "ValidBear": ApplyPatchAction},
          {}))
Exemple #9
0
 def test_valid_bear_actions(self):
     my_bear_action = MyBearAction()
     self.section.append(
         Setting('default_actions',
                 'MyBear: MyBearAction, ValidBear: ApplyPatchAction'))
     self.assertEqual(get_default_actions(self.section, [my_bear_action]),
                      ({
                          'MyBear': my_bear_action,
                          'ValidBear': ApplyPatchAction
                      }, {}))
 def test_no_value(self):
     self.section.append(Setting('default_actions', ''))
     self.assertEqual(get_default_actions(self.section), ({}, {}))
 def test_no_key(self):
     self.assertEqual(get_default_actions(self.section), ({}, {}))
 def test_no_value(self):
     self.section.append(Setting("default_actions", ""))
     self.assertEqual(get_default_actions(self.section), ({}, {}))
 def test_no_key(self):
     self.assertEqual(get_default_actions(self.section), ({}, {}))