Skip to content

Commit 3d00c42

Browse files
committed
chore: modify tests for uppervound and lowerbound by using the objec tnot primary data type
1 parent a529a9f commit 3d00c42

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

eventsourcingdb/handlers/upper_bound.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ def __post_init__(self):
1414
parameter_name='UpperBound',
1515
reason='type must be either "inclusive" or "exclusive"'
1616
)
17+
if int(self.id) < 0:
18+
raise InvalidParameterError(
19+
parameter_name='UpperBound',
20+
reason='id must be non-negative'
21+
)

tests/test_read_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ async def test_throws_error_for_invalid_lower_bound(
338338
):
339339
client = prepared_database.with_authorization.client
340340

341-
with pytest.raises(InvalidParameterError):
341+
with pytest.raises(ValueError):
342342
async for _ in client.read_events(
343343
'/',
344344
ReadEventsOptions(
@@ -372,7 +372,7 @@ async def test_throws_error_for_invalid_upper_bound(
372372
):
373373
client = prepared_database.with_authorization.client
374374

375-
with pytest.raises(InvalidParameterError):
375+
with pytest.raises(ValueError):
376376
async for _ in client.read_events(
377377
'/',
378378
ReadEventsOptions(

0 commit comments

Comments
 (0)