|
|
@@ -20,7 +20,8 @@ client = TestClient(get_application(Configuration(Server("localhost", 8585))))
|
|
|
# }
|
|
|
|
|
|
def test_post_main():
|
|
|
- requirements = (Path(__file__).parent.parent / Path("data/mock_requirements.txt")).read_text()
|
|
|
+ file_path = Path(__file__).parent.parent / Path("data/mock_requirements.txt")
|
|
|
+ requirements = file_path.read_text()
|
|
|
mock_input = {
|
|
|
"ctrl": "cin",
|
|
|
"input": {
|
|
|
@@ -32,13 +33,14 @@ def test_post_main():
|
|
|
}
|
|
|
}
|
|
|
response = client.post("/", json=mock_input)
|
|
|
- assert response.status_code == 201
|
|
|
+ assert response.status_code == 200
|
|
|
assert response.json() == {
|
|
|
"ctrl": "ok",
|
|
|
"output": {
|
|
|
"dout": {
|
|
|
"type": "inline",
|
|
|
"content": requirements + "\n\nChecked!",
|
|
|
+ "name": file_path.name,
|
|
|
"encoding": "text/plain"
|
|
|
}
|
|
|
}
|