TheNerdful8/Lecture2Gether

Lecture2Go returns different URL formats

Closed this issue · 0 comments

Flova commented

The URL format of a known l2g video changes randomly(?) this results in a test fail which results in the ci failing sporadically. These symptoms have been discussed previously in #108 and debugging was added in #111. This debugging shows that the URLs differ in an insignificant(?) matter for the production software, but because the URL isn't matching the given URL exactly the test fails.

FAIL: test.test_l2go_metadata
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/.cache/pypoetry/virtualenvs/lecture2gether-flask-l7P8K6HX-py3.8/lib/python3.8/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/runner/work/Lecture2Gether/Lecture2Gether/lecture2gether_flask/test.py", line 86, in test_l2go_metadata
    assert meta_data['creatorLink'] == 'https://lecture2go.uni-hamburg.de/l2go/-/get/0/0/0/0/0/?_lgopenaccessvideos_WAR_lecture2goportlet_searchQuery=Prof. Dr. Olaf Asbach', f" The actual creatorLink was {meta_data['creatorLink']}"
AssertionError:  The actual creatorLink was https://lecture2go.uni-hamburg.de/l2go/-/get/0/0/0/0/0/?_lgopenaccessvideos_WAR_lecture2goportlet_searchQuery=Prof.+Dr.+Olaf+Asbach
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): lecture2go.uni-hamburg.de
urllib3.connectionpool: DEBUG: https://lecture2go.uni-hamburg.de:443 "POST /l2go/-/get/l/4577 HTTP/1.1" 200 None
--------------------- >> end captured logging << ---------------------

The important part is where Prof.+Dr.+Olaf+Asbach obviously does not equal Prof. Dr. Olaf Asbach.
This could be solved using a proper URL library to compare or format these URLs.
Alternatively, the second possible URL could be added to the check.