-
Notifications
You must be signed in to change notification settings - Fork 8
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
gdc.py: Show error code of failed download request #20
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be awesome if you can add some tests. Let me know if you need any help.
Yeah, I am working on it. |
Add "test_download_error()" to print the error code on the console. This will print a failure message along with the error code of the network error that happened.
As of now, the |
@@ -69,6 +69,11 @@ def test_download(): | |||
os.unlink(file_path) | |||
|
|||
|
|||
def test_download_error(): | |||
uuid = "something-invalid-0101" | |||
gdc.download(uuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start! However, you are not asserting the output to some expected output, so the test is not running. You may take a look at the other tests in the same file for some inspiration. 😃
uuid = "something-invalid-0101"
actual = gdc.download(uuid)
expected = <insert the string here>
assert actual == expected
Also, take a look at the CONTRIBUTING file in #17 .
@@ -88,3 +93,6 @@ def test_get_samples_clinical(): | |||
project_id = "TCGA-OV" | |||
actual = gdc.get_samples_clinical(project_id) | |||
assert actual['case_id'][0] == "71faa2c1-0d5b-4dcc-bdf9-f2405f29907c" | |||
|
|||
|
|||
test_download_error() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need not to execute the function. pytest
will discover the test and will run by itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I forgot to remove that part after testing locally, will remove it.
@roshnet need a rebase. |
No description provided.