Example #1
0
    def it_raises_if_comment_id_is_not_found(darwin_client: Client):
        workflow_id = 1234
        endpoint: str = f"/workflows/{workflow_id}/workflow_comment_threads"
        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.post_workflow_comment(workflow_id, "My comment.")

        assert str(
            exception.value
        ) == f"Unable to retrieve comment id for workflow: {workflow_id}."
Example #2
0
    def it_returns_comment_id(darwin_client: Client):
        comment_id: int = 1234
        workflow_id: int = 1
        endpoint: str = f"/workflows/{workflow_id}/workflow_comment_threads"
        json_response: Dict[str, Any] = {"id": comment_id}

        responses.add(responses.POST,
                      darwin_client.url + endpoint,
                      json=json_response,
                      status=200)
        assert darwin_client.post_workflow_comment(workflow_id,
                                                   "My comment.") == comment_id