Skip to content

Commit

Permalink
Upgrade to jsonrpc-base 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
emlove committed Mar 17, 2021
1 parent eea72c9 commit 262e393
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion requirements-test.txt
@@ -1,7 +1,7 @@
flake8==3.7.8
coverage==5.5
coveralls==3.0.1
jsonrpc-base==1.1.0
jsonrpc-base>=2.0.0
aiohttp>=3.0.0
pytest-aiohttp==0.3.0
pytest==6.2.2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -20,7 +20,7 @@
long_description_content_type='text/x-rst',
long_description=open('README.rst').read(),
install_requires=[
'jsonrpc-base==1.1.0',
'jsonrpc-base>=2.0.0',
'aiohttp>=3.0.0',
],
classifiers=[
Expand Down
9 changes: 8 additions & 1 deletion tests.py
Expand Up @@ -326,11 +326,18 @@ def handler2(server, data):

def handler3(server, data):
request = json.loads(data)
assert request["params"] == {'foo': 'bar'}
assert request["params"] == [{'foo': 'bar'}]

server._session.handler = handler3
await server.foobar({'foo': 'bar'}, _notification=True)

def handler3(server, data):
request = json.loads(data)
assert request["params"] == {'foo': 'bar'}

server._session.handler = handler3
await server.foobar(**{'foo': 'bar'}, _notification=True)


async def test_simultaneous_calls(event_loop, server):
# Test that calls can be delivered simultaneously, and can return out
Expand Down
12 changes: 7 additions & 5 deletions tox.ini
Expand Up @@ -10,29 +10,31 @@ envlist =
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/jsonrpc_websocket
commands =
pytest --cov-report term-missing --cov=jsonrpc_websocket tests.py
pytest --cov-report term-missing --cov=jsonrpc_websocket tests.py {posargs}
deps =
-r{toxinidir}/requirements-test.txt

[testenv:py36]
basepython = python3.6
deps =
{[testenv]deps}
{[testenv]deps}
asynctest==0.13.0

[testenv:py37]
basepython = python3.7
deps =
{[testenv]deps}
{[testenv]deps}
asynctest==0.13.0

[testenv:py38]
basepython = python3.8
deps =
{[testenv]deps}
{[testenv]deps}

[testenv:py39]
basepython = python3.9
deps =
{[testenv]deps}
{[testenv]deps}

[testenv:flake8]
basepython = python
Expand Down

0 comments on commit 262e393

Please sign in to comment.