-
-
Notifications
You must be signed in to change notification settings - Fork 614
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
Mocking Torrent internals #53
Comments
I don't have much experience with mocking, so I'm open to suggestions. If you can provide mocks to be included with the torrent repo I would be appreciative. Open any PR you need to make this happen. |
Sorry for my PR, i add some abstraction layer in my and it allows me to mock torrent package without changing it. |
Great to see you solved it. If any of the mocked tests can be submitted that would be useful. |
Now i have some expirience with torrent package, so, i will add some readme and examples in a few days. |
Cheers |
Hi. I writing tests for my downloader and i don't want to download anything there. So, i ran into troubles with mocking Torrent.
You define Torrent struct as
I undestand, that you want to encapsulate it's logic from the outside code. But it creates some barrier for changing it's internals from the client tests. Your tests is defined in the same package as library, so you can do anything in tests. It is impossible to do it from my tests.
The good practice for testing libraries is defining it's tests in separate package
torrent_test
for example.Is there any way(interfaces magic or something else) to totally mock downloading and write tests without network access?
The text was updated successfully, but these errors were encountered: