def test_sample_template_post_req_no_access(self): obs = sample_template_post_req(1, '*****@*****.**', '16S', 'filepath') exp = { 'status': 'error', 'message': 'User does not have access to study' } self.assertEqual(obs, exp)
def test_sample_template_post_req(self): obs = sample_template_post_req(1, '*****@*****.**', '16S', 'uploaded_file.txt') exp = {'status': 'success', 'message': '', 'file': 'uploaded_file.txt'} self.assertEqual(obs, exp) obs = r_client.get('sample_template_1') self.assertIsNotNone(obs) # This is needed so the clean up works - this is a distributed system # so we need to make sure that all processes are done before we reset # the test database wait_for_processing_job(loads(obs)['job_id'])
def test_sample_template_post_req(self): obs = sample_template_post_req(1, "*****@*****.**", "16S", "uploaded_file.txt") exp = {"status": "success", "message": "", "file": "uploaded_file.txt"} self.assertEqual(obs, exp) obs = r_client.get("sample_template_1") self.assertIsNotNone(obs) # This is needed so the clean up works - this is a distributed system # so we need to make sure that all processes are done before we reset # the test database redis_info = loads(r_client.get(loads(obs)["job_id"])) while redis_info["status_msg"] == "Running": sleep(0.05) redis_info = loads(r_client.get(loads(obs)["job_id"]))
def test_sample_template_post_req(self): obs = sample_template_post_req(1, '*****@*****.**', '16S', 'uploaded_file.txt') exp = {'status': 'success', 'message': '', 'file': 'uploaded_file.txt'} self.assertEqual(obs, exp) obs = r_client.get('sample_template_1') self.assertIsNotNone(obs) # This is needed so the clean up works - this is a distributed system # so we need to make sure that all processes are done before we reset # the test database redis_info = loads(r_client.get(loads(obs)['job_id'])) while redis_info['status_msg'] == 'Running': sleep(0.05) redis_info = loads(r_client.get(loads(obs)['job_id']))
def test_sample_template_post_req_no_access(self): obs = sample_template_post_req(1, "*****@*****.**", "16S", "filepath") exp = {"status": "error", "message": "User does not have access to study"} self.assertEqual(obs, exp)
def test_sample_template_post_req_no_access(self): obs = sample_template_post_req(1, '*****@*****.**', '16S', 'filepath') exp = {'status': 'error', 'message': 'User does not have access to study'} self.assertEqual(obs, exp)