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