def test_valid_proc_type_b(self, input): self.assertFalse( Capt.valid_proc_type(self, self.one_dict, self.devices, self.test_logger)) self.assertFalse( Capt.valid_proc_type(self, self.one_test_dict, self.devices, self.test_logger))
def test_valid_proc_num(self): self.assertFalse( Capt.valid_proc_num(self, self.empty_dict, self.test_logger)) self.assertFalse( Capt.valid_proc_num(self, self.two_dict, self.test_logger)) self.assertTrue( Capt.valid_proc_num(self, self.one_dict, self.test_logger))
def test_valid_concurrent_num(self): for i in range(-1, 8): if i <= 0 or i >= 6: self.assertFalse( Capt.valid_concurrent_num(self, i, self.test_logger)) if i >= 1 and i <= 5: self.assertTrue( Capt.valid_concurrent_num(self, i, self.test_logger))
def setUp(self): self.test_logger = Capt.set_logger(self, 'test_logger', logging.DEBUG) self.empty_dict = {} self.one_dict = {'code_upgrade': 'yes'} self.two_dict = {'code_upgrade': 'yes', 'test_code_upgrade': 'yes'} self.one_bad_dict = {'fail': 'yes'} self.one_test_dict = {'test_code_upgrade': 'yes'} self.devices = ['10.10.10.10']
def setUp(self): self.test_logger = Capt.set_logger(self, 'test_logger', logging.DEBUG) self.loopback = "127.0.0.1" self.blackhole = "203.0.113.0" # reserved for documentation (0.0.0.0 is localhost on linux) self.test_list1 = ['a', 'b'] self.test_list2 = ['b', 'c'] self.test_list3 = ['d'] self.test_list4 = ['d', 'e']
def test_set_logger(self): self.assertTrue(Capt.set_logger(self, 'T.E.S.T', logging.INFO))