Skip to content

Commit a16716c

Browse files
committed
Fix unit test mocks to include server-version
1 parent f6ef0e7 commit a16716c

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

tests/unit/test_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def test_basics():
1717
def test_from_connection():
1818
connection = mock.Mock()
1919
connection.facades = {"Action": 2}
20+
connection.info = {"server-version": '3.0'}
2021
action_facade = client.ActionFacade.from_connection(connection)
2122
assert action_facade
2223

tests/unit/test_connection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ async def test_out_of_order(event_loop):
5454
'juju.client.connection.Connection.login',
5555
base.AsyncMock(return_value={'response': {
5656
'facades': minimal_facades,
57+
'server-version': '3.0',
5758
}}),
5859
), \
5960
mock.patch('juju.client.connection.Connection._get_ssl'), \
@@ -150,7 +151,9 @@ async def test_follow_redirect(event_loop):
150151
wsForCont2 = WebsocketMock([
151152
{'request-id': 1},
152153
{'request-id': 2},
153-
{'request-id': 3, 'response': {'result': minimal_facades}},
154+
{'request-id': 3, 'response': {'result': minimal_facades,
155+
'server-version': '3.0',
156+
}},
154157
])
155158

156159
con = None
@@ -186,6 +189,7 @@ async def test_rpc_none_results(event_loop):
186189
'juju.client.connection.Connection.login',
187190
base.AsyncMock(return_value={'response': {
188191
'facades': minimal_facades,
192+
'server-version': '3.0',
189193
}}),
190194
), \
191195
mock.patch('juju.client.connection.Connection._get_ssl'), \

0 commit comments

Comments
 (0)