Skip to content

Commit

Permalink
fix: Add test cases to improve coverage over postgres datastore provi…
Browse files Browse the repository at this point in the history
…der.
  • Loading branch information
anubhav756 committed Nov 14, 2024
1 parent 0f04932 commit 9ed6434
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions retrieval_service/datastore/providers/postgres_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,3 +604,26 @@ async def test_policies_search(
res, sql = await ds.policies_search(query_embedding, similarity_threshold, top_k)
assert res == expected
assert sql is not None


async def test_validate_ticket_valid(ds: postgres.Client):
flight, sql = await ds.validate_ticket(
airline="UA",
flight_number="1158",
departure_airport="SFO",
departure_time="2024-01-01 05:57:00",
)
assert flight is not None
assert sql is not None
assert flight.id == 1


async def test_validate_ticket_invalid(ds: postgres.Client):
flight, sql = await ds.validate_ticket(
airline="XX",
flight_number="9999",
departure_airport="ZZZ",
departure_time="2024-01-01 05:57:00",
)
assert flight is None
assert None is None

0 comments on commit 9ed6434

Please sign in to comment.