-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtests.py
28 lines (20 loc) · 845 Bytes
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import unittest
from starlette.testclient import TestClient
import yaas
class SmokeTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.client = TestClient(yaas.app)
def test_index(self):
r = self.client.get('/')
self.assertEqual(r.status_code, 200)
def test_video(self):
video_url = 'https://www.youtube.com/watch?v=mNFx28NGLfI'
r = self.client.get('/details', params={'url': video_url})
self.assertEqual(r.status_code, 200)
self.assertNotIn('error', r.text)
def test_playlist(self):
playlist_url = 'https://www.youtube.com/watch?v=jHgZh4GV9G0&list=PLHy7G7ndrUmpWqBkNKjJRT5urGiPW63Iq'
r = self.client.get('/details', params={'url': playlist_url})
self.assertEqual(r.status_code, 200)
self.assertNotIn('error', r.text)