Skip to content

Commit

Permalink
enhancement #46: add producer test
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienDanieau committed Aug 7, 2024
1 parent a69a09c commit 01600a8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dev = black==23.10.1
isort==5.12.0
pygobject-stubs==2.10.0
pytest==7.4.3
pytest-asyncio==0.23.8
coverage==7.3.2

[options.entry_points]
Expand Down
4 changes: 4 additions & 0 deletions tests/test_list_producers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ def test_empty_list(signalling_host: str, signalling_port: int) -> None:
producers = utils.get_producer_list(signalling_host, signalling_port)

assert len(producers) == 0


# @pytest.mark.asyncio
# async def test_some_asyncio_code(signalling_host: str, signalling_port: int) -> None:
16 changes: 16 additions & 0 deletions tests/test_producer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pytest

from gst_signalling import GstSignallingProducer


@pytest.mark.asyncio
async def test_simple_producer(signalling_host: str, signalling_port: int) -> None:
producer = GstSignallingProducer(
host=signalling_host,
port=signalling_port,
name="pytest producer",
)

await producer.connect()
assert len(producer.peer_id) == 36
await producer.close()

0 comments on commit 01600a8

Please sign in to comment.