From c53b778c12d09d929d7f57de1e24bf8ca80a62e0 Mon Sep 17 00:00:00 2001 From: romkazor Date: Sun, 10 Mar 2024 13:19:13 +0300 Subject: [PATCH 1/3] AMI: fix QueueAdd multi message wrong detect --- panoramisk/actions.py | 2 ++ tests/fixtures/queue_add.yaml | 5 +++++ tests/test_manager_with_fixtures.py | 9 +++++++++ 3 files changed, 16 insertions(+) create mode 100644 tests/fixtures/queue_add.yaml diff --git a/panoramisk/actions.py b/panoramisk/actions.py index b5d7b9c..f7dbc36 100644 --- a/panoramisk/actions.py +++ b/panoramisk/actions.py @@ -79,6 +79,8 @@ def multi(self): return True elif 'will follow' in msg: return True + elif msg == 'added interface to queue': + return False elif msg.startswith('added') and msg.endswith('to queue'): return True elif msg.endswith('successfully queued') and self['async'] != 'false': diff --git a/tests/fixtures/queue_add.yaml b/tests/fixtures/queue_add.yaml new file mode 100644 index 0000000..a6a948f --- /dev/null +++ b/tests/fixtures/queue_add.yaml @@ -0,0 +1,5 @@ +Response: Success +ActionID: action/transaction_uid/1/1 +Message: Added interface to queue + + diff --git a/tests/test_manager_with_fixtures.py b/tests/test_manager_with_fixtures.py index 1997edf..a85d891 100644 --- a/tests/test_manager_with_fixtures.py +++ b/tests/test_manager_with_fixtures.py @@ -54,6 +54,15 @@ def test_queue_status(manager): assert len(responses) == 9 +def test_queue_add(manager): + manager = manager(stream='queue_add.yaml') + future = manager.send_action({'Action': 'QueueAdd', + 'Queue': 'xxxxxxxxxxxxxxxx-tous', + 'Interface': 'SIP/000000'}) + responses = future.result() + assert len(responses) == 4 + + def test_pjsip_show_endpoint(manager): manager = manager(stream='pjsip_show_endpoint.yaml') future = manager.send_action({'Action': 'PJSIPShowEndpoint', From 25c75706241f98c97324b9e125c18ee15ff0bd98 Mon Sep 17 00:00:00 2001 From: romkazor Date: Sun, 10 Mar 2024 13:38:11 +0300 Subject: [PATCH 2/3] TESTS: fix tox tests --- tests/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 From bc0272babf6b5e022df16b5bbd71dcdb096297cf Mon Sep 17 00:00:00 2001 From: romkazor Date: Sun, 10 Mar 2024 16:56:17 +0300 Subject: [PATCH 3/3] TESTS: add python 3.12 --- .github/workflows/tox.yml | 4 ++-- setup.py | 2 ++ tox.ini | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 4889dd7..1dfd16c 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [3.7, 3.8, 3.9, "3.10", "3.11"] + python: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 @@ -24,4 +24,4 @@ jobs: run: tox -e py - name: Run flake8 / docs run: tox -e flake8,docs - if: "matrix.python == '3.10' || matrix.python == '3.11'" + if: "matrix.python == '3.10' || matrix.python == '3.11' || matrix.python == '3.12'" diff --git a/setup.py b/setup.py index 3dc21cf..7c348dc 100755 --- a/setup.py +++ b/setup.py @@ -34,6 +34,8 @@ def read(*rnames): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Communications :: Telephony', 'Topic :: Software Development :: Libraries :: Python Modules', ], diff --git a/tox.ini b/tox.ini index 0d06038..f51b921 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37,py38,py39,py310,flake8,docs +envlist = py37,py38,py39,py310,py311,py312,flake8,docs [flake8] max-line-length = 120