-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use as a Python library #5
Conversation
tap fixes and bump version
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.
Thank you very much ⭐
self.center = center_name | ||
self.hold_date = hold_date | ||
|
||
assert library in [METAGENOME, METATRANSCRIPTOME] |
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.
Is it okay to assert in a non test script?
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.
Good q – sort of. I think it makes sense here because: in CLI mode, the user input of library
is already validated because I added choices=
to the argparse
. (Generally you should not use assert
ions to check user input, because assertion checks can be disabled at runtime by running python in "optimise" mode.) So here the assertion can only fail through programming error – where assertions are useful to sanity check things that should always be true. Would be slightly better if the "library user" input was validated differently (e.g. a Pydantic type or explicit check) but in my opinion this kind of check is okay for that, and the stacktrace for this failing should be self explanatory.
tests/unit/test_submit_study.py
Outdated
|
||
|
||
def test_submit_study(study_submission_xml_dir, monkeypatch): | ||
ena_dropbopx = responses.add( |
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.
'dropbox'? and below
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.
Thkna yuo!
This PR:
assembly_uploader
as a Python libraryIn short it makes this possible: