Skip to content
Snippets Groups Projects
Commit 7fe30aa1 authored by Andreas Valder's avatar Andreas Valder
Browse files

add a very basic test for campus import

parent 1ebee253
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,11 @@ class VideoTestCase(unittest.TestCase): ...@@ -40,6 +40,11 @@ class VideoTestCase(unittest.TestCase):
r = c.get('/courses') r = c.get('/courses')
assert r.status_code == 200 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): def test_course(self):
with self.app as c: with self.app as c:
# normal # normal
...@@ -246,6 +251,29 @@ class VideoTestCase(unittest.TestCase): ...@@ -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': '{}'}) r = self.app.post('/internal/jobs/api/job/1/ping', data={'apikey': '1', 'host': 'test', 'status': '{}', 'state': '{}'})
assert r.status_code == 205 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__': if __name__ == '__main__':
unittest.main() unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment