Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Write tests #6

Open
cuducos opened this issue Jul 21, 2018 · 3 comments
Open

Write tests #6

cuducos opened this issue Jul 21, 2018 · 3 comments

Comments

@cuducos
Copy link
Owner

cuducos commented Jul 21, 2018

Probably a good way to learn abouk unittest.mock (for Portuguese speakers, I have a YouTube video about mocks).

@humrochagf
Copy link

Since both tweepy and botometer uses requests, the responses library can be a good call for those tests

@cuducos
Copy link
Owner Author

cuducos commented Jul 23, 2018

Maybe mea-culpa but anyway: when I'm about to write code that heavily depends on external and unknown (for me) APIs, I usually think TDD is not the best choice in terms of productivity. That was my case last Friday when I coded what became this repository.

In that situation I tend to draft something that works, a prototype or a MVP. Once I'm a bit more familiar with the API responses, I step back and write some (regression?) tests. And this is the current status of this project IMHO. So that's why we have a total of zero tests so far.

@cuducos
Copy link
Owner Author

cuducos commented Jan 2, 2020

Thanks for @paulharte now we have a basis for writing tests. To PR #19 I added coverage so this issue has a sort of feedback on which parts are mostly untested:

Name                                Stmts   Miss  Cover
-------------------------------------------------------
twitter_cleanup/__init__.py            77     47    39%
twitter_cleanup/__main__.py            27     27     0%
twitter_cleanup/authentication.py      25     13    48%
twitter_cleanup/botometer.py           39     22    44%
twitter_cleanup/cache.py               73     59    19%
twitter_cleanup/user.py                19      5    74%
-------------------------------------------------------
TOTAL                                 260    173    33%

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

No branches or pull requests

2 participants