| 1 |
========================================== |
| 2 |
:mod:`panoramisk.testing` - Writing tests |
| 3 |
========================================== |
| 4 |
|
| 5 |
.. |
| 6 |
>>> import os |
| 7 |
>>> stream = os.path.join('tests', 'fixtures', 'ping.yaml') |
| 8 |
|
| 9 |
.. code-block:: python |
| 10 |
|
| 11 |
>>> from panoramisk import testing |
| 12 |
>>> manager = testing.Manager(stream=stream) # stream is a filename contaning an Asterisk trace |
| 13 |
>>> future = manager.send_action({'Action': 'Ping'}) |
| 14 |
>>> resp = future.result() |
| 15 |
>>> assert 'ping' in resp |
| 16 |
>>> assert resp.ping == 'Pong' |
| 17 |
|
| 18 |
API |
| 19 |
--- |
| 20 |
|
| 21 |
.. automodule:: panoramisk.testing |
| 22 |
|
| 23 |
.. autoclass:: Manager |
| 24 |
:members: |