test: add response_metadata test.

This commit is contained in:
Francisco 2023-07-08 13:49:12 -05:00
parent 75ad24fdbb
commit b16aea5b1d
3 changed files with 17 additions and 1 deletions

View File

@ -5,5 +5,9 @@ Estudio: Librería para jugar con Freeswitch.
+ Al conectarse al servidor se recibe: "Content-Type: auth/request"
+ comando para autenticarse: "auth"
+ respuesta de autenticacion correcta: "Content-Type: command/reply\nReply-Text: +OK accepted"
## Tests
Correr los tests
```sh
python -m unittest tests/response_metadata.py
```

0
tests/__init__.py Normal file
View File

View File

@ -0,0 +1,12 @@
import unittest
from FreeTwitch.response_metadata import ResponseMetadata
class TestResponseMetadata(unittest.TestCase):
def test_from_string(self):
response = """Content-Type: api/response
Content-Length: 28"""
response_metadata = ResponseMetadata.from_string(response)
self.assertEqual(28, response_metadata.length)