Skip to content

Commit 65b9f63

Browse files
authored
Create test_driver_location_store.py
1 parent aa0a830 commit 65b9f63

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test_driver_location_store.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import pytest
2+
from src.driver-location-service.location_store import DriverLocationStore
3+
from src.common.models import DriverLocationEvent
4+
5+
6+
def test_driver_location_store_updates_and_retrieves():
7+
8+
store = DriverLocationStore()
9+
10+
event = DriverLocationEvent(
11+
driver_id="d1",
12+
latitude=40.7128,
13+
longitude=-74.0060,
14+
accuracy=3.5,
15+
timestamp=1234567890
16+
)
17+
18+
store.update_location(event)
19+
results = store.get_nearby_drivers(40.7128, -74.0060, radius_km=5)
20+
21+
assert len(results) == 1
22+
assert results[0]["driver_id"] == "d1"

0 commit comments

Comments
 (0)