Пример #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:])