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

Basic framework for testing flask server #61

Merged
merged 54 commits into from
Feb 23, 2020
Merged

Conversation

dhakim87
Copy link
Collaborator

Added test_integration.py with the ability to modify the test database, run the server, and call the api methods. This will form the foundation for writing tests for issue #37 but separate pull requests will test and fix each checkbox of that issue

Copy link
Member

@wasade wasade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to shift this under unittest.TestCase? An example can be found here:

https://github.com/qiime2/q2-emperor/blob/master/q2_emperor/tests/test_plot.py#L21

…nts and other projects in the qiime2 ecosystem
…set this field to null as no account will be associated with them
…of mock kits/samples. Working through the list of integration tests (yes, they all still fail)
…unt registration that checks for valid kit name then adds the new account
…ssociation and integration test: add_sample_from_kit
… added sample info, and for associating/dissociating samples with surveys
Now return empty 0 byte responses rather than the JSON of empty string, which is in fact two characters long
Added test for sample+survey association
Added mechanisms to return information about a survey template beyond just its ID
…able. Explicitly restricted fields written at DB layer with introduction of new SampleInfo class. Specified isoformat for datetime serialization/deserialization over json (unclear if this is true iso8601 or if relying on python isoformat may burn us later) Added integration test for editing sample information
…e current form. Its a hacky patch job because at the end of the day, we have NO LOCALIZATION: Every single question, every single response, in american and british, are exactly the same. We will need a better plan for doing localization in the future. It hooks in in too many places and the actual translation step will not be robust as it lacks context.
@dhakim87
Copy link
Collaborator Author

Thank you both for the extremely thorough reviews! It looks like we have a couple of action items for the next meetings and some new issues. The discussion items we should cover are:

  • Should we refactor repo layer to split into exception throwing and non exception throwing methods? (get, try_get, delete, try_delete)
  • What is the exact policy for checking "upstream ids"? Is there a standard pattern we can apply throughout to ensure that we're always checking everything we need to check?
  • Examine source_barcodes_surveys and decide whether or not to refactor it (and if so, to what?)
  • What is the exact policy determining which 4XX errors to throw. How do we pick between 400, 401, 403, 404, and 422?

@AmandaBirmingham
Copy link
Collaborator

Ok, I have signed off on this PR :)

@wasade wasade merged commit 972a028 into master Feb 23, 2020
@dhakim87 dhakim87 deleted the st_dh_flask_testing branch April 3, 2020 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants