Model/backend/tests/test_search_epc.py
2026-06-01 14:00:31 +00:00

24 lines
720 B
Python

import pytest
import os
from backend.SearchEpc import SearchEpc # Replace with your actual module name
from dotenv import load_dotenv
# If this backend/.env file is present, we load it
if os.path.exists("backend/.env"):
load_dotenv("backend/.env")
class TestSearchEpcIntegration:
@pytest.fixture
def epc_auth_token(self):
return os.getenv("EPC_AUTH_TOKEN")
def test_search_housenumber(self):
eg1 = "Flat A11, Mortimer House, Grendon Road, Exeter"
res1 = SearchEpc.get_house_number(eg1, None)
assert res1 == "A11"
eg2 = "Flat A9, Mortimer House, Grendon Road, Exeter, EX1 2NL"
res2 = SearchEpc.get_house_number(eg2, None)
assert res2 == "A9"