Пример #1
0
    def test_artifact_delete_req(self):
        obs = artifact_delete_req(3, '*****@*****.**')
        exp = {'status': 'success', 'message': ''}
        self.assertEqual(obs, exp)

        with self.assertRaises(QiitaDBUnknownIDError):
            Artifact(3)
Пример #2
0
 def test_artifact_delete_req_no_access(self):
     obs = artifact_delete_req(self.artifact.id, '*****@*****.**')
     exp = {
         'status': 'error',
         'message': 'User does not have access to study'
     }
     self.assertEqual(obs, exp)
Пример #3
0
    def test_artifact_delete_req(self):
        obs = artifact_delete_req(self.artifact.id, '*****@*****.**')
        exp = {'status': 'success', 'message': ''}
        self.assertEqual(obs, exp)

        # 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_prep_information_job(1)
Пример #4
0
    def test_artifact_delete_req(self):
        obs = artifact_delete_req(self.artifact.id, '*****@*****.**')
        exp = {'status': 'success', 'message': ''}
        self.assertEqual(obs, exp)

        # 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_prep_information_job(1)
Пример #5
0
    def test_artifact_delete_req(self):
        obs = artifact_delete_req(3, '*****@*****.**')
        exp = {'status': 'success', 'message': ''}
        self.assertEqual(obs, exp)

        # 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
        obs = r_client.get('prep_template_1')
        self.assertIsNotNone(obs)
        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']))
Пример #6
0
    def test_artifact_delete_req(self):
        obs = artifact_delete_req(self.artifact.id, '*****@*****.**')
        exp = {'status': 'success', 'message': ''}
        self.assertEqual(obs, exp)

        # 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
        obs = r_client.get('prep_template_1')
        self.assertIsNotNone(obs)
        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']))
Пример #7
0
 def test_artifact_delete_req_no_access(self):
     obs = artifact_delete_req(self.artifact.id, '*****@*****.**')
     exp = {'status': 'error',
            'message': 'User does not have access to study'}
     self.assertEqual(obs, exp)
Пример #8
0
 def test_artifact_delete_req_error(self):
     obs = artifact_delete_req(1, '*****@*****.**')
     exp = {'status': 'error',
            'message': 'Cannot delete artifact 1: it has children: 2, 3'}
     self.assertEqual(obs, exp)