예제 #1
0
    def test_copy_job_check_complete(self, vector_client):
        vector_client.get_product_from_query_status.return_value = self.get_product_from_query_status_response
        job = CopyJob("product_id", vector_client)

        self.assertTrue(job._check_complete())

        job.properties["state"] = "RUNNING"
        self.assertFalse(job._check_complete())
    def test_copy_job_check_complete(self, vector_client):
        vector_client.get_product_from_query_status.return_value = (
            self.get_product_from_query_status_response)
        job = CopyJob("product_id", vector_client)

        assert job._check_complete()

        job.properties["state"] = "RUNNING"
        assert not job._check_complete()
예제 #3
0
    def test_copy_job_check_complete_exception(self, vector_client):
        vector_client.get_product_from_query_status.return_value = self.get_product_from_query_status_response
        job = CopyJob("product_id", vector_client)
        job.properties["state"] = "FAILURE"

        with self.assertRaises(FailedJobError):
            job._check_complete()

        job.properties["state"] = "DONE"
        job.properties["errors"] = ["some error description"]
        with self.assertRaises(FailedJobError):
            job._check_complete()