示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 def test_select_no_input(self):
     self.assertFalse(select_vhost_multiple([]))
示例#4
0
 def test_select_no_input(self):
     self.assertEqual(len(select_vhost_multiple([])), 0)