class TestMasterBucket_Connection(unittest.TestCase): def setUp(self): self.my_bucket = MasterBucket(name="test_name") self.my_bucket.add_task(hp.run_host_name) def test_MasterBucket_execute_hostname(self): self.my_bucket_result = self.my_bucket.execute() my_one_result = self.my_bucket_result[0].task_rst[0].raw self.assertEqual(my_one_result, 'gene')
class TestMasterBucketResult(unittest.TestCase): def setUp(self): self.my_bucket = MasterBucket(name="test_name") self.my_bucket.add_task(hp.id_fun, 1, 1) self.my_bucket_result = self.my_bucket.execute() def test_MasterBucketResult__get_tablestr_bucket_result(self): self.assertIsInstance(self.my_bucket_result._get_tablestr_bucket_result(), list) def test_MasterBucketResult_get_table_bucket_result(self): self.assertIsInstance(self.my_bucket_result.get_table_bucket_result(), unicode)
class TestMasterBucket(unittest.TestCase): def setUp(self): self.my_bucket = MasterBucket(name="test_name") self.my_bucket.add_task(hp.id_fun, 1, 1) def test_MasterBucket_execute_output_type(self): self.assertIsInstance(self.my_bucket.execute(), MasterBucketResult) def test_MasterBucket_list_bucket(self): my_str_list = self.my_bucket.list_bucket() assert_to = "[ id - function name - times to execute - args - kwargs ]\n[ 0 - id_fun - 1 - (1,) - {} ]" self.assertEqual(my_str_list, assert_to)
def setUp(self): self.my_bucket = MasterBucket(name="test_name") self.my_bucket.add_task(hp.run_host_name)
def setUp(self): self.my_bucket = MasterBucket(name="test_name") self.my_bucket.add_task(hp.id_fun, 1, 1)
def setUp(self): self.my_bucket = MasterBucket(name="test_name") self.my_bucket.add_task(hp.id_fun, 1, 1) self.my_bucket_result = self.my_bucket.execute()