From 46419cf70e605d0dcfe28d396a8efa11947bd93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 19 Dec 2023 13:20:44 +0100 Subject: [PATCH] Fix mock issues --- tests/client/test_proxy.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/client/test_proxy.py b/tests/client/test_proxy.py index d9894a0f..dfde07f3 100644 --- a/tests/client/test_proxy.py +++ b/tests/client/test_proxy.py @@ -41,14 +41,22 @@ def test_format_iter_filters(): def test_item_resource_iter_no_params(): - items_proxy = _ItemsResourceProxy(mock.Mock, mock.Mock(), 'mocked_key') + class MockClient: + def __init__(self): + self._hsclient = object() + + items_proxy = _ItemsResourceProxy(mock.Mock, MockClient(), 'mocked_key') items_proxy._origin = mock.Mock() items_proxy.iter(count=123) assert items_proxy._origin.list.call_args == mock.call(None, count=123) def test_item_resource_iter_with_params(): - items_proxy = _ItemsResourceProxy(mock.Mock, mock.Mock(), 'mocked_key') + class MockClient: + def __init__(self): + self._hsclient = object() + + items_proxy = _ItemsResourceProxy(mock.Mock, MockClient(), 'mocked_key') items_proxy._origin = mock.Mock() items_proxy.iter(count=123, startts=12345) assert (items_proxy._origin.list.call_args ==