Skip to content

Commit 6497764

Browse files
committed
tests: fix coverage
1 parent a760d0d commit 6497764

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

doc/changelog.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ Changelog
66
Added
77
^^^^^
88
- Implement :meth:`Schema.get_attribute <scim2_models.Schema.get_attribute>`.
9-
- Implement :meth:`ListResponse.start_index_0 <scim2_models.ListResponse.start_index_0>`
10-
and :meth:`ListResponse.start_index_1 <scim2_models.ListResponse.start_index_1>`
11-
and :meth:`SearchRequest.start_index_0 <scim2_models.SearchRequest.start_index_0>`
9+
- Implement :meth:`SearchRequest.start_index_0 <scim2_models.SearchRequest.start_index_0>`
1210
and :meth:`SearchRequest.start_index_1 <scim2_models.SearchRequest.start_index_1>`.
1311

1412
[0.2.10] - 2024-12-02

scim2_models/rfc7644/list_response.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,3 @@ def check_results_number(
121121
)
122122

123123
return obj
124-
125-
@property
126-
def start_index_0(self):
127-
"""The 0 indexed start index."""
128-
return self.start_index - 1 if self.start_index is not None else None
129-
130-
@property
131-
def stop_index_0(self):
132-
"""The 0 indexed stop index."""
133-
return (
134-
self.start_index_0 + self.count
135-
if self.start_index_0 is not None and self.count is not None
136-
else None
137-
)

tests/test_search_request.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,9 @@ def test_attributes_or_excluded_attributes():
7474
}
7575
with pytest.raises(ValidationError):
7676
SearchRequest.model_validate(payload)
77+
78+
79+
def test_index_0_properties():
80+
req = SearchRequest(start_index=1, count=10)
81+
assert req.start_index_0 == 0
82+
assert req.stop_index_0 == 10

0 commit comments

Comments
 (0)