Skip to content

Commit

Permalink
Merge pull request #116 from romkazor/master
Browse files Browse the repository at this point in the history
AMI: fix QueueAdd multi message wrong detect
  • Loading branch information
gawel authored Mar 10, 2024
2 parents c786190 + bc0272b commit ba90798
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'"
2 changes: 2 additions & 0 deletions panoramisk/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
Expand Down
Empty file added tests/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions tests/fixtures/queue_add.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Response: Success
ActionID: action/transaction_uid/1/1
Message: Added interface to queue


9 changes: 9 additions & 0 deletions tests/test_manager_with_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit ba90798

Please sign in to comment.