Get a page of products starting from start_id.
(start_id, page_size)
| 148 | print("Simulating paginated API responses:") |
| 149 | |
| 150 | def get_page(start_id, page_size): |
| 151 | """Get a page of products starting from start_id.""" |
| 152 | results = [] |
| 153 | count = 0 |
| 154 | for product_id, product in tree.range(start_id, None): |
| 155 | results.append((product_id, product)) |
| 156 | count += 1 |
| 157 | if count >= page_size: |
| 158 | break |
| 159 | return results |
| 160 | |
| 161 | # Simulate pagination |
| 162 | page_size = 10 |
no test coverage detected