示例#1
0
    def test_artifact_post_request(self):
        # No access
        with self.assertRaises(QiitaHTTPError):
            artifact_post_req(User('*****@*****.**'), 1)

        artifact_post_req(User('*****@*****.**'), 2)
        # Wait until the job is completed
        wait_for_prep_information_job(1)
        # Check that the delete function has been actually called
        obs = r_client.get(loads(r_client.get('prep_template_1'))['job_id'])
        self.assertIn('Cannot delete artifact 2', obs)
示例#2
0
    def test_artifact_post_request(self):
        # No access
        with self.assertRaises(QiitaHTTPError):
            artifact_post_req(User('*****@*****.**'), 1)

        obs = artifact_post_req(User('*****@*****.**'), 2)
        self.assertCountEqual(obs.keys(), ['job'])
        # Wait until the job is completed
        wait_for_prep_information_job(1)
        # Check that the delete function has been actually called
        job = ProcessingJob(loads(r_client.get('prep_template_1'))['job_id'])
        self.assertEqual(job.status, 'error')
        self.assertIn('Cannot delete artifact 2', job.log.msg)
示例#3
0
    def test_artifact_post_request(self):
        # No access
        with self.assertRaises(QiitaHTTPError):
            artifact_post_req(User('*****@*****.**'), 1)

        obs = artifact_post_req(User('*****@*****.**'), 2)
        self.assertEqual(obs.keys(), ['job'])
        # Wait until the job is completed
        wait_for_prep_information_job(1)
        # Check that the delete function has been actually called
        job = ProcessingJob(loads(r_client.get('prep_template_1'))['job_id'])
        self.assertEqual(job.status, 'error')
        self.assertIn('Cannot delete artifact 2', job.log.msg)