def test_select_correct(self, mock_util): mock_util().checklist.return_value = (display_util.OK, [ self.vhosts[3].display_repr(), self.vhosts[2].display_repr() ]) vhs = select_vhost_multiple( [self.vhosts[3], self.vhosts[2], self.vhosts[1]]) self.assertTrue(self.vhosts[2] in vhs) self.assertTrue(self.vhosts[3] in vhs) self.assertFalse(self.vhosts[1] in vhs)
def test_select_cancel(self, mock_util): mock_util().checklist.return_value = (display_util.CANCEL, "whatever") vhs = select_vhost_multiple([self.vhosts[2], self.vhosts[3]]) self.assertFalse(vhs)
def test_select_no_input(self): self.assertFalse(select_vhost_multiple([]))
def test_select_no_input(self): self.assertEqual(len(select_vhost_multiple([])), 0)