Exemple #1
0
    def it_raises_if_workflow_id_is_not_found(darwin_client: Client):
        item_id: int = 1234
        endpoint: str = f"/dataset_items/{item_id}/workflow"
        json_response: Dict[str, Any] = {}

        responses.add(responses.POST,
                      darwin_client.url + endpoint,
                      json=json_response,
                      status=200)

        with pytest.raises(ValueError) as exception:
            darwin_client.instantitate_item(item_id)

        assert str(
            exception.value) == f"No Workflow Id found for item_id: {item_id}"
Exemple #2
0
    def it_returns_workflow_id(darwin_client: Client):
        item_id: int = 1234
        workflow_id: int = 1
        endpoint: str = f"/dataset_items/{item_id}/workflow"
        json_response: Dict[str, Any] = {"current_workflow_id": workflow_id}

        responses.add(responses.POST,
                      darwin_client.url + endpoint,
                      json=json_response,
                      status=200)
        assert darwin_client.instantitate_item(item_id) == workflow_id