예제 #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:])