mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge pull request #437 from Hestia-Homes/remote-assessment-api
moving test setup
This commit is contained in:
commit
b3eaa16380
1 changed files with 11 additions and 3 deletions
|
|
@ -1,11 +1,19 @@
|
|||
import pytest
|
||||
import os
|
||||
from backend.SearchEpc import SearchEpc # Replace with your actual module name
|
||||
from dotenv import load_dotenv
|
||||
|
||||
EPC_AUTH_TOKEN = os.getenv("EPC_AUTH_TOKEN")
|
||||
# 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")
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"address, postcode, uprn, skip_os, lmk_key, n_old_epcs",
|
||||
[
|
||||
|
|
@ -27,7 +35,7 @@ class TestSearchEpcIntegration:
|
|||
|
||||
],
|
||||
)
|
||||
def test_find_property(self, address, postcode, uprn, skip_os, lmk_key, n_old_epcs):
|
||||
def test_find_property(self, epc_auth_token, address, postcode, uprn, skip_os, lmk_key, n_old_epcs):
|
||||
"""
|
||||
Integration test for `find_property`, making actual API calls.
|
||||
"""
|
||||
|
|
@ -39,7 +47,7 @@ class TestSearchEpcIntegration:
|
|||
address1=address,
|
||||
postcode=postcode,
|
||||
uprn=uprn,
|
||||
auth_token=EPC_AUTH_TOKEN,
|
||||
auth_token=epc_auth_token,
|
||||
os_api_key=os_api_key,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue