You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/libs/test/client_streaming_test.py

32 lines
1002 B

import os
import unittest
import logging
import time
import uuid
from subprocess import Popen, PIPE
from signalrcore.hub_connection_builder import HubConnectionBuilder
from signalrcore.subject import Subject
from test.base_test_case import BaseTestCase, Urls
class TestClientStreamMethod(BaseTestCase):
def test_stream(self):
self.complete = False
self.items = list(range(0,10))
subject = Subject()
self.connection.send("UploadStream", subject)
while(len(self.items) > 0):
subject.next(str(self.items.pop()))
subject.complete()
self.assertTrue(len(self.items) == 0)
class TestClientStreamMethodMsgPack(TestClientStreamMethod):
def get_connection(self):
return super().get_connection(msgpack=True)
class TestClientNosslStreamMethodMsgPack(TestClientStreamMethodMsgPack):
server_url = Urls.server_url_no_ssl
class TestClientNosslStreamMethod(TestClientStreamMethod):
server_url = Urls.server_url_no_ssl