delete response model for at/detach
All checks were successful
checks-impure / test (pull_request) Successful in 30s
checks / test (pull_request) Successful in 3m24s

This commit is contained in:
Georg-Stahn
2023-12-04 22:11:00 +01:00
parent b69eab03d5
commit ae35c25f91
2 changed files with 6 additions and 7 deletions

View File

@@ -178,7 +178,7 @@ def get_attached_entities(
return entities
@router.get("/api/v1/detach", response_model=Optional[Entity], tags=[Tags.entities])
@router.get("/api/v1/detach")
async def detach(
background_tasks: BackgroundTasks,
entity_did: str = "did:sov:test:1234",
@@ -192,7 +192,7 @@ async def detach(
return {"message": "Detaching in the background"}
@router.get("/api/v1/attach", response_model=Optional[Entity], tags=[Tags.entities])
@router.get("/api/v1/attach")
async def attach(
background_tasks: BackgroundTasks,
entity_did: str = "did:sov:test:1234",
@@ -215,9 +215,9 @@ def attach_entity(db: Session, entity_did: str) -> None:
response = httpx.get(f"http://{db_entity.ip}", timeout=2)
print(response)
# test with:
# while true ; do printf 'HTTP/1.1 200 OK\r\n\r\ncool, thanks' | nc -l -N localhost 5555 ; done
# client test (apt install python3-httpx):
# httpx http://localhost:5555
# while true ; do printf 'HTTP/1.1 200 OK\r\n\r\ncool, thanks' | nc -l -N localhost 5555 ; done
# client test (apt install python3-httpx):
# httpx http://localhost:5555
# except not reached set false
time.sleep(1)
except Exception as e: