Esempio n. 1
0
 def test_call_library_remove_with_correct_attrs(self):
     lib = mock.MagicMock(
         constraint_ticket=mock.MagicMock(remove=mock.Mock())
     )
     command.remove(lib, ["TICKET", "RESOURCE"], {})
     lib.constraint_ticket.remove.assert_called_once_with(
         "TICKET", "RESOURCE",
     )
Esempio n. 2
0
 def test_call_library_remove_with_correct_attrs(self):
     # pylint: disable=no-self-use
     lib = mock.MagicMock(constraint_ticket=mock.MagicMock(
         remove=mock.Mock()))
     command.remove(lib, ["TICKET", "RESOURCE"], _modifiers(False))
     lib.constraint_ticket.remove.assert_called_once_with(
         "TICKET",
         "RESOURCE",
     )
Esempio n. 3
0
 def test_call_library_remove_with_correct_attrs(self):
     # pylint: disable=no-self-use
     lib = mock.MagicMock(
         constraint_ticket=mock.MagicMock(remove=mock.Mock())
     )
     command.remove(lib, ["TICKET", "RESOURCE"], _modifiers(False))
     lib.constraint_ticket.remove.assert_called_once_with(
         "TICKET", "RESOURCE",
     )
Esempio n. 4
0
 def test_refuse_args_count(self):
     self.assertRaises(CmdLineInputError, lambda: command.remove(
         mock.MagicMock(),
         ["TICKET"],
         {},
     ))
     self.assertRaises(CmdLineInputError, lambda: command.remove(
         mock.MagicMock(),
         ["TICKET", "RESOURCE", "SOMETHING_ELSE"],
         {},
     ))