Beispiel #1
0
 def test_success_node(self):
     resource.resource_unmove_unban(
         self.lib, ["resource", "node"], dict_to_modifiers(dict())
     )
     self.resource.unmove_unban.assert_called_once_with(
         "resource", node="node", master=False, expired=False, wait=False
     )
Beispiel #2
0
 def test_no_args(self):
     with self.assertRaises(CmdLineInputError) as cm:
         resource.resource_unmove_unban(self.lib, [],
                                        dict_to_modifiers(dict()))
     self.assertEqual(cm.exception.message,
                      "must specify a resource to clear")
     self.resource.unmove_unban.assert_not_called()
Beispiel #3
0
 def test_success_all_options(self):
     resource.resource_unmove_unban(
         self.lib,
         ["resource", "node"],
         dict_to_modifiers(dict(master=True, expired=True, wait="10")),
     )
     self.resource.unmove_unban.assert_called_once_with(
         "resource", node="node", master=True, expired=True, wait="10"
     )
Beispiel #4
0
 def test_too_many_args(self):
     with self.assertRaises(CmdLineInputError) as cm:
         resource.resource_unmove_unban(
             self.lib,
             ["resource", "arg1", "arg2"],
             dict_to_modifiers(dict()),
         )
     self.assertIsNone(cm.exception.message)
     self.resource.unmove_unban.assert_not_called()