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