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

Tests #43

Open
elifoster opened this issue Jun 23, 2016 · 6 comments
Open

Tests #43

elifoster opened this issue Jun 23, 2016 · 6 comments

Comments

@elifoster
Copy link
Member

Right now, we don't have tests for any methods that do any HTTP stuff. This is kinda blargh. I would really enjoy having all of our methods have associated tests, so we don't have stupid errors like #34.

My only issue is I don't know how we should actually make these tests. We could use mocks, but I don't particularly enjoy using mocks for this kind of thing because you end up testing that you set up your mocks correctly, and not that you interact with the API correctly. Some other libraries, like the MediaWiki-Bot Perl library uses one of the many test Wikipedias to perform unit testing. Obviously, internet connection issues can result in errored builds, which is not so great.

@elifoster
Copy link
Member Author

@xbony2 and @APerson241 Do you guys have any ideas for this? I still would very much like some unit testing going on in this lib.

@xbony2
Copy link
Member

xbony2 commented Jul 30, 2016

What do we need tests for again? ;)

@elifoster
Copy link
Member Author

...

So we can ensure that everything is working as expected, and so we don't get stupid errors because we forgot to manually test one method when changing an API.

@enterprisey
Copy link
Contributor

There must be some way to set up a kinda-sketchy local scaffolding-style MediaWiki instance, right? Short of that, I think mocking all the things is acceptable for testing passing stuff through and processing

@enterprisey
Copy link
Contributor

^ Furthermore, setting up a local latest-version MW instance (Travis ci?) would ensure that we don't have problems with breaking API changes.

@elifoster
Copy link
Member Author

We could also use VCR to record actual API responses and test against those

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants