Skip to content

Commit

Permalink
Merge pull request #58 from jphacks/hotfix/fix_test_generator_spec
Browse files Browse the repository at this point in the history
delete db connection dependency
  • Loading branch information
motty-mio2 authored Nov 17, 2023
2 parents 88dea20 + defba7b commit d2c1201
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/test/api/t_gen_resp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@

import requests

from kb_2315.backend.crud import crud_shoe
from kb_2315.backend.schemas import schema_sensor, schema_session
from kb_2315.config import conf


try:
device_id: int = crud_shoe.search_shoe_by()[0].id
except IndexError:
device_id = crud_shoe.add_shoe()
device_id = 100


resp: schema_session.create_session = schema_session.create_session.model_validate(
obj=requests.get(f"{conf.host_url}/session/?device_id={device_id}").json()
obj=requests.get(f"{conf.host_url}/api/session/?device_id={device_id}").json()
)

str_session_id = str(resp.session_id)
Expand All @@ -26,7 +22,7 @@

for i in range(it):
requests.post(
url=f"{conf.host_url}/sensor/",
url=f"{conf.host_url}/api/sensor/",
json=schema_sensor.sensor(
session_id=str_session_id,
device_id=device_id,
Expand Down

0 comments on commit d2c1201

Please sign in to comment.