def test_sample_template_put_req_no_access(self): obs = sample_template_put_req(1, '*****@*****.**', 'filepath') exp = { 'status': 'error', 'message': 'User does not have access to study' } self.assertEqual(obs, exp)
def test_sample_template_put_req_no_template(self): obs = sample_template_put_req(self.new_study.id, '*****@*****.**', 'uploaded_file.txt') self.assertEqual( obs, { 'status': 'error', 'message': 'Sample template %d does not ' 'exist' % self.new_study.id })
def test_sample_template_put_req(self): obs = sample_template_put_req(1, '*****@*****.**', '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_put_req(self): obs = sample_template_put_req(1, "*****@*****.**", "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_put_req(self): obs = sample_template_put_req(1, '*****@*****.**', '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_put_req_no_template(self): obs = sample_template_put_req(self.new_study.id, "*****@*****.**", "uploaded_file.txt") self.assertEqual( obs, {"status": "error", "message": "Sample template %d does not " "exist" % self.new_study.id} )
def test_sample_template_put_req_no_access(self): obs = sample_template_put_req(1, "*****@*****.**", "filepath") exp = {"status": "error", "message": "User does not have access to study"} self.assertEqual(obs, exp)
def test_sample_template_put_req_no_template(self): obs = sample_template_put_req(self.new_study.id, '*****@*****.**', 'uploaded_file.txt') self.assertEqual(obs, {'status': 'error', 'message': 'Sample template %d does not ' 'exist' % self.new_study.id})
def test_sample_template_put_req_no_access(self): obs = sample_template_put_req(1, '*****@*****.**', 'filepath') exp = {'status': 'error', 'message': 'User does not have access to study'} self.assertEqual(obs, exp)