bvanheu / pytoutv

TOU.TV client library and user interfaces written in Python 3
96 stars 23 forks source link

Added more tests: info, list, search using name and URLs #86

Closed gboudreau closed 7 years ago

gboudreau commented 7 years ago

Tests will fail until #84 and #87 are merged.

gboudreau commented 7 years ago

meh. Tests now fail because of the country locks in place by tou.tv... https://s3.amazonaws.com/archive.travis-ci.org/jobs/189899625/log.txt

Unknown exception: <class 'RuntimeError'>: Le contenu sélectionné n'est pas disponible dans votre pays
gboudreau commented 7 years ago

Tried to set a Canadian proxy in the Travis CI config, but that proxy doesn't seem to work from their build servers, even though it works from my workstation. So meh again... I think those tests really need to be there, to prevent regressions, but I don't know how we can have them run successfully on Travis CI...

simark commented 7 years ago

I have tried to do that kind of tests in the past, but it was not really a good idea. First, because of the country issue as you have found, but also because they were flake (mostly because of the old API have intermittent timeouts). In the last few weeks I have tried to refactor the code a bit to introduce unit tests, in which we test the behavior of a single class by mocking the components with which that class interacts. It's a bit more difficult to do, but I think that's the right kind of tests for Travis.

There is nothing that prevents us to write another testsuite that would test toutv for real, which we could run automatically daily on our personal computer/server. This way, we'd get some quick feedback if tou.tv were to change something in their API. This testsuite would obviously not be run by Travis.