-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add comprehensive test cases #203
Comments
Hello! |
greeting ! I will be contributing here |
Hello 👋🏼 @spwoodcock , can I work on this issue too ? |
Hi @spwoodcock , I am writing tests for the make_data_extract.py and filter_data.py modules. However, I am unable to create a database connection through the URI passed into the MakeDataExtract class which is passed into the PostgresClient class from osm-rawdata. There are two outcomes from my testing:
In this case, I get an error from the And localhost doesn't work for the docker-compose configuration. How should I work around this? |
Hi @owolabioromidayo , thanks for the feedback. Don't worry about updating the tests for make data extract, as it may be removed in future in favour of osm-rawdata. As for filter data, you could update the code as part of a PR to make it configurable for connections other than localhost (so that testing can be carried out using the container based database). |
@valentina-buoro sure thing 😄 |
Currently all the real functionality of make_data_extract.py is now in osm-rawdata, so all this does now is filter data. So this would be a test for the FilterData() class only. |
Okay, got it. The parse method of the FilterData class creates self.tags and self.keep attributes which have been commented out of usage in the cleanData method with a FIXME comment. What should be done concerning that? |
Ignore those. :-) Some of that is from past experiments, and may be brought back to life later, but commented out to reduce introducing weird errors. Eventually we'll clean that up, fixed and added or deleted. |
Okay :-) I made a PR with 2 basic tests for filter_data.py now. I also fixed a tiny bug in it. Would appreciate any feedback. |
hi @spwoodcock , i would like to contribute and work on this issue. I request to be assigned to it. Surely i will continue to understand the entire code base |
Sure thing @RonaldRonnie 👍 |
Hi @spwoodcock , am i advised to use pytest-mock while carrying out test??? |
Hi! While it's possible to do so, I don't think we need it. We can use real data files where needed, then for OdkCentral.py we run the tests via docker compose so have access to the real API of ODK Central, meaning we can send requests and get real responses instead of having to mock 👍 |
thank you @spwoodcock for the knowledge and guidance |
Hello @spwoodcock , I have made a PR onto this issue and I will grateful for the feedback. |
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: