Files
nucleus/tests/test_response.py
T

28 lines
691 B
Python
Raw Normal View History

2026-04-21 09:01:50 +03:00
__author__ = 'RemiZOffAlex'
__email__ = 'remizoffalex@mail.ru'
import unittest
2026-06-20 00:40:03 +03:00
from io import BytesIO
2026-06-18 17:58:58 +03:00
from nucleus.response.common import Response
from nucleus.response.stream import ResponseStream
2026-04-21 09:01:50 +03:00
class TestResponse(unittest.TestCase):
2026-06-20 00:40:03 +03:00
def test_response_str(self):
2026-04-21 09:01:50 +03:00
response = Response('ok')
2026-06-18 17:58:58 +03:00
for item in ResponseStream(response):
print(item)
2026-06-20 00:40:03 +03:00
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)