Open vsoch opened 4 years ago
having tests would be great! but meanwhile I will follow up with a few separate "issues" on top of https://github.com/con/tributors/issues/22#issuecomment-653251074 initial experience
okay! Let's prioritize tests though, since we don't have them (it makes me uneasy).
What about starting with an integration test for sample use cases where sample input is provided and sample output is verified? vcr library then could be used to record any interaction which happen in that initial run (and committed as well, but be careful to not run with secrets in your environment variables)
Then as bugs are fixed - provide unit tests which code the fixed up behavior in corresponding functions
Good idea - we will want to do this after adding support for some kind of --from
or --lookup
.
But no more today! Dinnertime!
as requested in #48 I think it would be useful to establish a "high level" unittest for verifying finding out correct ORCID ids.
other-name
if unicode search above cannot be supportedvcr
library to record transactions (and to be committed) so subsequent test runs would just reuse recorded tapes. I think it should be overall beneficial to not abuse orcid interface, while still testing cli/tributors code itself. Once in a blue moon (weekly?) there could be a test run which would ignore the tapes and does it "fully" thus testing if any changes in underlying returned results changed or API was deprecated etc.I can add this to the PR! Can you tell me more about what you mean by using the vcr library to "record transactions" (I'm not familiar with this). My basic intuition would be to add a few tests for the list you generated, to be run on a PR, which I don't think would be abusing the API. What tapes?
https://vcrpy.readthedocs.io/en/latest/ FWIW, we use it in datalad for some tests and have helper: https://github.com/datalad/datalad/blob/master/datalad/support/vcr_.py#L44 but most likely you don't need anything like that ;)
hey @yarikoptic ! I've done just about all the changes / updates that I think are good for this first version, so please have it it / unlease the Yarik! Now is the right time to start review and tell me all the things I did wrong :) In all seriousness I always can quickly put together a first go, but then lots of tweaking / fine tuning / testing is needed. Actually, we don't technically have proper python tests, so if you want to make a list of tests to write I can go from there!