Skip to content

Commit

Permalink
Fix mock issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gallaecio committed Dec 19, 2023
1 parent 7343eb7 commit 46419cf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/client/test_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ==
Expand Down

0 comments on commit 46419cf

Please sign in to comment.