Commit 7fe30aa1 authored by Andreas Valder's avatar Andreas Valder

add a very basic test for campus import

parent 1ebee253
......@@ -39,6 +39,11 @@ class VideoTestCase(unittest.TestCase):
self.login(c)
r = c.get('/courses')
assert r.status_code == 200
def test_lecture(self):
with self.app as c:
r = c.get('/15ws-afi/6981')
assert r.status_code == 200
def test_course(self):
with self.app as c:
......@@ -246,6 +251,29 @@ class VideoTestCase(unittest.TestCase):
r = self.app.post('/internal/jobs/api/job/1/ping', data={'apikey': '1', 'host': 'test', 'status': '{}', 'state': '{}'})
assert r.status_code == 205
def test_sorter(self):
with self.app as c:
r = self.app.get('/courses')
import sorter
match, fmt = sorter.sort_file('08ws-swt-081118.mp4')
assert len(match) == 1
assert match[0]['id'] == 104
match, fmt = sorter.sort_file('15ss-zkk-extremale-codes-1080p.mp4')
assert len(match) == 1
assert match[0]['id'] == 6095
def test_campusimport(self):
with self.app as c:
self.login(c)
r = self.app.post('/internal/import/257', data={'campus.new.url': 'https://www.campus.rwth-aachen.de/rwth/all/event.asp?gguid=0x4664DBD60E5A02479B53089BF0EB0681&tguid=0x0B473CF286B45B4984CD02565C07D6F8', 'campus.new.type': 'Vorlesung'})
assert r.status_code == 200
r = self.app.get('/internal/import/257/now')
assert r.status_code == 200
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment