@@ -58,40 +58,6 @@ def side_effect(_, link, **kwargs):
58
58
assert req .call_count >= math .ceil (call_count )
59
59
60
60
61
- def test_no_paging_required ():
62
- """If "next" link not present, current items should be included."""
63
-
64
- items = [{"name" : "a" }, {"name" : "b" }, {"name" : "c" }]
65
- obj = RestObj (items = items , count = len (items ))
66
-
67
- with mock .patch ("sasctl.core.request" ) as req :
68
- # Mock appears to be *sometimes* shared with mock created in `paging` fixture
69
- # above. Depending on execution order, this can result in calls to the mock
70
- # made by other tests to be counted here. Explicitly reset to prevent this.
71
- req .reset_mock ()
72
- try :
73
- req .assert_not_called ()
74
- except AssertionError as e :
75
- raise AssertionError (
76
- f"method_calls={ req .mock_calls } call_args={ req .call_args_list } "
77
- )
78
-
79
- pager = PageIterator (obj )
80
-
81
- # Returned page of items should preserve item order
82
- items = next (pager )
83
- for idx , item in enumerate (items ):
84
- assert item .name == RestObj (items [idx ]).name
85
-
86
- # No req should have been made to retrieve additional data.
87
- try :
88
- req .assert_not_called ()
89
- except AssertionError as e :
90
- raise AssertionError (
91
- f"method_calls={ req .mock_calls } call_args={ req .call_args_list } "
92
- )
93
-
94
-
95
61
def test_paging_required (paging ):
96
62
"""Requests should be made to retrieve additional pages."""
97
63
obj , items , _ = paging
0 commit comments