Add tests
This commit is contained in:
@@ -11,13 +11,13 @@ def _open_file(path):
|
||||
|
||||
@aioresponses()
|
||||
def test_Async(*mock):
|
||||
vid = ''
|
||||
vid = '__test_id__'
|
||||
_text = _open_file('tests/testdata/paramgen_firstread.json')
|
||||
_text = json.loads(_text)
|
||||
mock[0].get(
|
||||
f"https://www.youtube.com/live_chat?v={vid}&is_popout=1", status=200, body=_text)
|
||||
try:
|
||||
chat = LiveChatAsync(video_id='')
|
||||
chat = LiveChatAsync(video_id='__test_id__')
|
||||
assert chat.is_alive()
|
||||
chat.terminate()
|
||||
assert not chat.is_alive()
|
||||
@@ -33,7 +33,7 @@ def test_MultiThread(mocker):
|
||||
responseMock.text = _text
|
||||
mocker.patch('requests.Session.get').return_value = responseMock
|
||||
try:
|
||||
chat = LiveChatAsync(video_id='')
|
||||
chat = LiveChatAsync(video_id='__test_id__')
|
||||
assert chat.is_alive()
|
||||
chat.terminate()
|
||||
assert not chat.is_alive()
|
||||
|
||||
Reference in New Issue
Block a user