Skip to content

Commit 45a9d20

Browse files
committed
Automated push for workflow: [Lint/#&]
1 parent a564adf commit 45a9d20

File tree

6 files changed

+19
-14
lines changed

6 files changed

+19
-14
lines changed

app/__init__.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
from app.main import app
44

55
pretty_errors.configure(
6-
separator_character = '*',
7-
filename_display = pretty_errors.FILENAME_EXTENDED,
8-
line_number_first = True,
9-
display_link = True,
10-
lines_before = 5,
11-
lines_after = 2,
12-
line_color = pretty_errors.RED + '> ' + pretty_errors.default_config.line_color,
13-
code_color = ' ' + pretty_errors.default_config.line_color,
14-
truncate_code = True,
15-
display_locals = True
6+
separator_character='*',
7+
filename_display=pretty_errors.FILENAME_EXTENDED,
8+
line_number_first=True,
9+
display_link=True,
10+
lines_before=5,
11+
lines_after=2,
12+
line_color=pretty_errors.RED + '> ' + pretty_errors.default_config.line_color,
13+
code_color=' ' + pretty_errors.default_config.line_color,
14+
truncate_code=True,
15+
display_locals=True
1616
)
1717
pretty_errors.blacklist('c:/python')

app/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pydantic import BaseSettings
44
from pathlib import Path
55

6+
67
class Settings(BaseSettings):
78

89
output_file_path: Path = Path("logs.txt")
@@ -25,4 +26,3 @@ class Settings(BaseSettings):
2526
config = Settings()
2627
if config.on_brain is True:
2728
config.robot_env["PYTHONPATH"] = config.robot_path
28-

app/main.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
app.include_router(routers.runner_router)
1515
app.include_router(routers.upload_router)
1616

17+
1718
@app.get("/")
1819
def root():
1920
return "Root of shepherd-2"
2021

22+
2123
@app.on_event("shutdown")
2224
def shutdown_event():
2325
"""Make sure that we kill any running usercode
@@ -27,4 +29,4 @@ def shutdown_event():
2729

2830

2931
if __name__ == '__main__':
30-
uvicorn.run(app, port=8080, host='0.0.0.0')
32+
uvicorn.run(app, port=8080, host='0.0.0.0')

app/routers.py

-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,3 @@ def upload_file(file: UploadFile):
5252
"filename": file.filename,
5353
"filesize": len(file)
5454
}
55-

app/runner.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _enter_ready_state(self) -> None:
5353

5454
def _enter_running_state(self) -> None:
5555
"""Send start signal to usercode"""
56-
pass # TODO:
56+
pass # TODO:
5757

5858
def _enter_stopped_state(self) -> None:
5959
"""Reap the users code"""
@@ -135,4 +135,5 @@ def _run_watchdog(self) -> None:
135135
self.next_state = States.STOPPED
136136
self.new_state_event.set()
137137

138+
138139
runner = Runner()

test/test_runner.py

+3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77

88
client = TestClient(app)
99

10+
1011
@pytest.mark.timeout(STATE_TRANS_TIMEOUT)
1112
def test_inital_state():
1213
"""The server is ready to run code within STATE_TRANS_TIMEOUT seconds of starting"""
1314
while (response := client.get("/state")).json() != "Ready":
1415
pass
1516
assert response.status_code == 200
1617

18+
1719
@pytest.mark.timeout(STATE_TRANS_TIMEOUT)
1820
def test_start():
1921
"""Code can be started"""
@@ -22,6 +24,7 @@ def test_start():
2224
pass
2325
assert response.status_code == 200
2426

27+
2528
@pytest.mark.timeout(STATE_TRANS_TIMEOUT)
2629
def test_stop():
2730
"""Code can be stopped within STATE_TRANS_TIMEOUT seconds of it commanding to be stopped"""

0 commit comments

Comments
 (0)