Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation error in .add_attachment_to_result() #34

Closed
Serhiy1 opened this issue Jun 10, 2020 · 1 comment · Fixed by #35
Closed

Documentation error in .add_attachment_to_result() #34

Serhiy1 opened this issue Jun 10, 2020 · 1 comment · Fixed by #35
Labels
bug Something isn't working

Comments

@Serhiy1
Copy link

Serhiy1 commented Jun 10, 2020

Hi there, Thanks for for this library, its a god send.

but I've noticed a small error in the example and possibly in the doc string.

The example states the following:

result = api.results.add_result_for_case(
    run_id=my_test_run["id"], 
    case_id=5, 
    status_id=1, 
    comment="Pass", 
    version="1"
)
attach = "attach.jpg"
api.attachments.add_attachment_to_result(result[0]["id"], attach)

But the type returned from api.results.add_result_for_case() is a dictionary, not a list containing a dictionary. Therefore result[0]["id"] produces a key error on the [0]

This seems to extend to the doc strings as pycharm also complains about the returned type, despite the code running without issue.

image

@tolstislon
Copy link
Owner

Hello. Thanks for the feedback.
Indeed add_result_for_case should return one result.

There is an error in the documentation and in the annotation.
I will try to fix it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants