+14
-1
@@ -3,12 +3,25 @@ __email__ = 'remizoffalex@mail.ru'
|
||||
|
||||
import unittest
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
from nucleus.response.common import Response
|
||||
from nucleus.response.stream import ResponseStream
|
||||
|
||||
|
||||
class TestResponse(unittest.TestCase):
|
||||
def test_response(self):
|
||||
def test_response_str(self):
|
||||
response = Response('ok')
|
||||
for item in ResponseStream(response):
|
||||
print(item)
|
||||
|
||||
def test_response_bytes(self):
|
||||
response = Response(b'ok')
|
||||
for item in ResponseStream(response):
|
||||
print(item)
|
||||
|
||||
def test_response_stream(self):
|
||||
file = BytesIO(b'ok')
|
||||
response = Response(file)
|
||||
for item in ResponseStream(response):
|
||||
print(item)
|
||||
|
||||
Reference in New Issue
Block a user