示例#1
0
 def test_empty(self):
     hostlist = restrict_hostlist([], None, None)
     self.assertEqual(hostlist, [])
示例#2
0
 def test_startat_and_stopbefore(self):
     hostlist = restrict_hostlist(self.hostlist, "c", "e")
     self.assertEqual(hostlist, self.hostlist[2:-2])
示例#3
0
 def test_stopbefore_before_startat(self):
     hostlist = restrict_hostlist(self.hostlist, "e", "c")
     self.assertEqual(hostlist, [])
示例#4
0
 def test_startat(self):
     hostlist = restrict_hostlist(self.hostlist, "c", None)
     self.assertEqual(hostlist, self.hostlist[2:])
示例#5
0
 def test_stopbefore(self):
     hostlist = restrict_hostlist(self.hostlist, None, "c")
     self.assertEqual(hostlist, self.hostlist[:2])
示例#6
0
 def test_invalid_startat(self):
     with self.assertRaises(HostSelectionError):
         restrict_hostlist([], "a", None)
示例#7
0
 def test_invalid_stopbefore(self):
     with self.assertRaises(HostSelectionError):
         restrict_hostlist([], None, "a")
示例#8
0
 def test_stopbefore(self):
     hostlist = restrict_hostlist(self.hostlist, None, "c")
     self.assertEqual(hostlist, ["a", "b"])
示例#9
0
 def test_startat_and_stopbefore(self):
     hostlist = restrict_hostlist(self.hostlist, "c", "e")
     self.assertEqual(hostlist, ["c", "d"])
示例#10
0
 def test_invalid_stopbefore(self):
     with self.assertRaises(HostSelectionError):
         restrict_hostlist([], None, "a")
示例#11
0
 def test_startat(self):
     hostlist = restrict_hostlist(self.hostlist, "c", None)
     self.assertEqual(hostlist, ["c", "d", "e", "f"])
示例#12
0
 def test_invalid_startat(self):
     with self.assertRaises(HostSelectionError):
         restrict_hostlist([], "a", None)
示例#13
0
 def test_empty(self):
     hostlist = restrict_hostlist([], None, None)
     self.assertEqual(hostlist, [])
示例#14
0
 def test_stopbefore_before_startat(self):
     hostlist = restrict_hostlist(self.hostlist, "e", "c")
     self.assertEqual(hostlist, [])
示例#15
0
 def test_startat(self):
     hostlist = restrict_hostlist(self.hostlist, "c", None)
     self.assertEqual(hostlist, ["c", "d", "e", "f"])
示例#16
0
 def test_startat(self):
     hostlist = restrict_hostlist(self.hostlist, "c", None)
     self.assertEqual(hostlist, self.hostlist[2:])