first setup, travel works, bjornd api works
This commit is contained in:
24
tests/test_travel.py
Normal file
24
tests/test_travel.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import sys
|
||||
sys.path.insert(0, "../src")
|
||||
from huizenbot import fiets_minuten, ov_minuten, geocode
|
||||
from config import *
|
||||
|
||||
# --- change these to test different postcodes ---
|
||||
POSTCODE_FROM = "3028GE"
|
||||
POSTCODE_FROM_9292 = "rotterdam/" + POSTCODE_FROM
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("=== Geocode ===")
|
||||
origin = geocode(POSTCODE_FROM)
|
||||
dest = geocode(MARK_WERK_POSTCODE)
|
||||
print(f" {POSTCODE_FROM} → {origin}")
|
||||
print(f" {MARK_WERK_POSTCODE} → {dest}")
|
||||
if not origin or not dest:
|
||||
print("Geocode mislukt, stop.")
|
||||
sys.exit(1)
|
||||
|
||||
print("\n=== Fiets (OSRM) ===")
|
||||
print(f" {fiets_minuten(origin, dest)} minuten")
|
||||
|
||||
print("\n=== OV (9292) ===")
|
||||
print(f" {ov_minuten(POSTCODE_FROM_9292, MARK_WERK_9292)} minuten")
|
||||
Reference in New Issue
Block a user