|
@@ -5,6 +5,7 @@ import magic
|
|
|
import arklog
|
|
|
from fastapi import APIRouter, Query, Request, Response
|
|
|
from fastapi.responses import JSONResponse
|
|
|
+import time
|
|
|
|
|
|
|
|
|
class MockRouter(APIRouter):
|
|
@@ -28,19 +29,22 @@ class MockRouter(APIRouter):
|
|
|
return JSONResponse(status_code=200, content={"ctrl": "ok"})
|
|
|
|
|
|
body = await request.json()
|
|
|
+ arklog.debug(body)
|
|
|
control = body.get("ctrl")
|
|
|
arklog.debug(control)
|
|
|
content = body.get("input").get("din").get("content")
|
|
|
file_path = Path(__file__).parent.parent / Path("data/mock_requirements.txt")
|
|
|
requirements = file_path.read_text() + "\n\nChecked!"
|
|
|
mime = magic.Magic(mime=True).from_file(file_path)
|
|
|
- assert content + "\n\nChecked!" == requirements
|
|
|
- return JSONResponse(status_code=201, content={
|
|
|
+ #time.sleep(5)
|
|
|
+ assert (content + "\n\nChecked!") == requirements
|
|
|
+ return JSONResponse(status_code=200, content={
|
|
|
"ctrl": "ok",
|
|
|
"output": {
|
|
|
"dout": {
|
|
|
"type": "inline",
|
|
|
"content": requirements,
|
|
|
+ "name": "mock_req.txt",
|
|
|
"encoding": mime
|
|
|
}
|
|
|
}
|