Beispiel #1
0
 def test_machine_actions_for_non_admin(self):
     handler = GeneralHandler(factory.make_User(), {})
     self.assertItemsEqual([
         'release', 'mark-broken', 'on', 'deploy', 'mark-fixed',
         'commission', 'abort', 'acquire', 'off', 'rescue-mode',
         'exit-rescue-mode', 'test'
     ], [action['name'] for action in handler.machine_actions({})])
Beispiel #2
0
 def test_machine_actions_for_non_admin(self):
     handler = GeneralHandler(factory.make_User(), {}, None)
     self.assertItemsEqual(
         [
             "release",
             "mark-broken",
             "on",
             "deploy",
             "mark-fixed",
             "commission",
             "abort",
             "acquire",
             "off",
             "rescue-mode",
             "exit-rescue-mode",
             "lock",
             "tag",
             "test",
             "override-failed-testing",
             "unlock",
         ],
         [action["name"] for action in handler.machine_actions({})],
     )
Beispiel #3
0
 def test_machine_actions_for_admin(self):
     handler = GeneralHandler(factory.make_admin(), {})
     actions_expected = self.dehydrate_actions(ACTIONS_DICT,
                                               NODE_TYPE.MACHINE)
     self.assertItemsEqual(actions_expected, handler.machine_actions({}))