|
11 | 11 | from sasctl.core import PageIterator, RestObj
|
12 | 12 |
|
13 | 13 |
|
14 |
| -@pytest.fixture(params=[(6, 2, 2), (6, 1, 4), (6, 5, 4), (6, 6, 2), (100, 10, 20)]) |
| 14 | +@pytest.fixture(scope="function", params=[(6, 2, 2), (6, 1, 4), (6, 5, 4), (6, 6, 2), (100, 10, 20)]) |
15 | 15 | def paging(request):
|
16 | 16 | """Create a RestObj designed to page through a collection of items and the
|
17 | 17 | collection itself.
|
@@ -64,20 +64,20 @@ def test_no_paging_required(self):
|
64 | 64 | items = [{"name": "a"}, {"name": "b"}, {"name": "c"}]
|
65 | 65 | obj = RestObj(items=items, count=len(items))
|
66 | 66 |
|
67 |
| - with mock.patch("sasctl.core.request") as request: |
| 67 | + with mock.patch("sasctl.core.request") as req: |
68 | 68 | pager = PageIterator(obj)
|
69 | 69 |
|
70 | 70 | # Returned page of items should preserve item order
|
71 | 71 | items = next(pager)
|
72 | 72 | for idx, item in enumerate(items):
|
73 | 73 | assert item.name == RestObj(items[idx]).name
|
74 | 74 |
|
75 |
| - # No request should have been made to retrieve additional data. |
| 75 | + # No req should have been made to retrieve additional data. |
76 | 76 | try:
|
77 |
| - request.assert_not_called() |
| 77 | + req.assert_not_called() |
78 | 78 | except AssertionError as e:
|
79 | 79 | raise AssertionError(
|
80 |
| - f"method_calls={request.mock_calls} call_args={request.call_args_list}" |
| 80 | + f"method_calls={req.mock_calls} call_args={req.call_args_list}" |
81 | 81 | )
|
82 | 82 |
|
83 | 83 | def test_paging_required(self, paging):
|
|
0 commit comments