Пример #1
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'}))
Пример #2
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"}))
Пример #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'}))
Пример #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"}))
Пример #5
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},
          {}))
Пример #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},
          {}))
Пример #7
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},
          {}))
Пример #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},
          {}))
Пример #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
                      }, {}))
Пример #10
0
 def test_no_value(self):
     self.section.append(Setting('default_actions', ''))
     self.assertEqual(get_default_actions(self.section), ({}, {}))
Пример #11
0
 def test_no_key(self):
     self.assertEqual(get_default_actions(self.section), ({}, {}))
Пример #12
0
 def test_no_value(self):
     self.section.append(Setting("default_actions", ""))
     self.assertEqual(get_default_actions(self.section), ({}, {}))
Пример #13
0
 def test_no_key(self):
     self.assertEqual(get_default_actions(self.section), ({}, {}))