KartikTalwar / Duolingo

Unofficial Duolingo API Written in Python
MIT License
825 stars 128 forks source link

Tests are failing #86

Closed Irio closed 4 years ago

Irio commented 4 years ago

The last commit to master has failing tests. The link is:

https://travis-ci.org/github/KartikTalwar/Duolingo/jobs/678833117

The last one with green status is this one, from four months ago:

https://travis-ci.org/github/KartikTalwar/Duolingo/jobs/647856619

Locally, two tests fail for me:

(duolingo-3.7.7) irio@DESKTOP-CD59K3G:~/workspace/Duolingo$ pytest tests.py
================================================= test session starts ==================================================platform linux -- Python 3.7.7, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
rootdir: /home/irio/workspace/Duolingo, inifile: setup.cfg
plugins: cov-2.9.0
collected 54 items

tests.py ..F..........................F........................                                                  [100%]

======================================================= FAILURES =======================================================___________________________________________ DuolingoTest.test_get_audio_url ____________________________________________
self = <tests.DuolingoTest testMethod=test_get_audio_url>

    def test_get_audio_url(self):
        # Setup
        vocab = self.lingo.get_vocabulary()
        word = vocab['vocab_overview'][0]['normalized_string']
        # Test
        response = self.lingo.get_audio_url(word)
>       assert isinstance(response, str)
E       AssertionError: assert False
E        +  where False = isinstance(None, str)

tests.py:232: AssertionError
_____________________________________ DuolingoOtherUsernameTest.test_get_audio_url _____________________________________
self = <tests.DuolingoOtherUsernameTest testMethod=test_get_audio_url>

    def test_get_audio_url(self):
        # Setup
        vocab = self.lingo.get_vocabulary()
        word = vocab['vocab_overview'][0]['normalized_string']
        # Test
        response = self.lingo.get_audio_url(word)
>       assert isinstance(response, str)
E       AssertionError: assert False
E        +  where False = isinstance(None, str)

tests.py:232: AssertionError

----------- coverage: platform linux, python 3.7.7-final-0 -----------
Name          Stmts   Miss  Cover   Missing
-------------------------------------------
duolingo.py     355    102    71%   75, 88, 101, 106-110, 114-115, 140, 143, 165-189, 196-203, 213-222, 230, 260, 314, 321, 329, 354, 362, 457-458, 463, 476-481, 485-491, 496-500, 503-513, 518, 524, 532-542, 566-574, 577-580, 607-608
tests.py        222      7    97%   80, 233-236, 262, 269
-------------------------------------------
TOTAL           577    109    81%

=============================================== short test summary info ================================================FAILED tests.py::DuolingoTest::test_get_audio_url - AssertionError: assert False
FAILED tests.py::DuolingoOtherUsernameTest::test_get_audio_url - AssertionError: assert False
SpangleLabs commented 4 years ago

Yeah, I think Duolingo changed their API, if I checkout 6d356368118cdedb44fdd1c27662c95f417db32f (the last commit that passed in travis) and run the tests, then test_get_audio_url() fails.

I had hoped that @KartikTalwar would set up travis to run daily, so these API changes would be spotted immediately, but I think he's just set it to run on each commit to master. Though, that would only have told us which day in February it failed, which isn't useful information now.

But yeah, I've not had a chance to look into fixing it yet, sorry!

SpangleLabs commented 4 years ago

Ah, This all got fixed, and I got the travis tests running daily, so I'm closing this now