Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski committed Oct 25, 2019
1 parent d6a7d65 commit cd6255a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ujson==1.35 # via sanic
urllib3==1.25.6 # via kubernetes, requests
uvloop==0.13.0 # via sanic
websocket-client==0.56.0 # via kubernetes
websockets==8.0.2 # via sanic
websockets==7.0

# The following packages are considered to be unsafe in a requirements file:
# setuptools==41.4.0 # via kubernetes, protobuf
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
'sanic>=0.8.0',
'prometheus-client',
'structlog',
'websockets==7.0', # fixme: temporarily pin
'synse-grpc==3.0.0a4', # fixme: for alpha v3 testing; update to stable v3 release
],
zip_safe=False,
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/api/test_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def make_payload(data, id=None, event=None):
def test_error_no_exception():
resp = websocket.error()

assert json.loads(resp) == {
assert resp == {
'id': -1,
'event': 'response/error',
'data': {
Expand All @@ -39,7 +39,7 @@ def test_error_synse_error():
ex=errors.InvalidUsage('invalid'),
)

assert json.loads(resp) == {
assert resp == {
'id': 1,
'event': 'response/error',
'data': {
Expand All @@ -59,7 +59,7 @@ def test_error_other_error():
ex=ValueError('uh oh'),
)

assert json.loads(resp) == {
assert resp == {
'id': 3,
'event': 'response/error',
'data': {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ def test_run_ok_with_metrics(self, mocker):

# --- Test case -----------------------------
synse = server.Synse()
assert 'expose_metrics' not in synse.app.router.routes_names.keys()
assert 'metrics' not in synse.app.router.routes_names.keys()

synse.run()
assert 'expose_metrics' in synse.app.router.routes_names.keys()
assert 'metrics' in synse.app.router.routes_names.keys()

mock_write.assert_called_once()
mock_initialize.assert_called_once()
Expand Down

0 comments on commit cd6255a

Please sign in to comment.