Skip to content

Commit 13e51bf

Browse files
authored
Merge pull request #44 from MarketSquare/fix-unittests
fix: unittests
2 parents 4c7980f + 104eb5d commit 13e51bf

1 file changed

Lines changed: 30 additions & 12 deletions

File tree

tests/test_app.py

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@
55

66
class EndpointTesttest_s(unittest.TestCase):
77
def test_is_service_available(self):
8-
response = self.__get_robot_webservice("/status")
8+
self.__get_robot_webservice("/status", expected_response_code=200)
99

10-
def test_is_robottask_startable(self):
10+
def test_is_all_robottask_startable(self):
1111
response = self.__get_robot_webservice(
12-
"/robotframework/run/all", expected_response_code=400
12+
"/robotframework/run/all", expected_response_code=500
1313
)
1414
self.__is_robot_failed(response=response)
1515

16-
def test_is_robottask_async_startable(self):
17-
self.__get_robot_webservice("/robotframework/run/all/async")
16+
def test_is_all_robottask_async_startable(self):
17+
self.__get_robot_webservice(
18+
"/robotframework/run/all/async", expected_response_code=200
19+
)
1820

19-
def test_is_robottask_startable(self):
21+
def test_is_other_robottask_startable(self):
2022
response = self.__get_robot_webservice("/robotframework/run/anotherTask")
2123
self.__is_robot_passed(response=response)
2224

23-
def test_is_robottask_async_startable(self):
25+
def test_is_other_robottask_async_startable(self):
2426
self.__get_robot_webservice("/robotframework/run/anotherTask/async")
2527

2628
def test_robottask_with_variables(self):
@@ -69,21 +71,37 @@ def test_is_robotreport_available(self):
6971

7072
def test_is_robot_run(self):
7173
with TestClient(app) as client:
72-
response = client.post("/robotframework/run", json={"task": "Another task", "test": "Demonstration Test"})
74+
response = client.post(
75+
"/robotframework/run",
76+
json={"task": "Another task", "test": "Demonstration Test"},
77+
)
7378
self.assertEqual(400, response.status_code)
74-
self.assertEqual("Options test and task cannot be both specified", response.text)
79+
self.assertEqual(
80+
"Options test and task cannot be both specified", response.text
81+
)
7582

76-
response = client.post("/robotframework/run", json={"task": "Another task", "sync": True})
83+
response = client.post(
84+
"/robotframework/run", json={"task": "Another task", "sync": True}
85+
)
7786
self.assertEqual(200, response.status_code)
7887

79-
response = client.post("/robotframework/run", json={"paths": ["examples"], "test": "Demonstration Test", "sync": True})
88+
response = client.post(
89+
"/robotframework/run",
90+
json={
91+
"paths": ["examples"],
92+
"test": "Demonstration Test",
93+
"sync": True,
94+
},
95+
)
8096
self.assertEqual(200, response.status_code)
8197

8298
def test_delete_robotlogs(self):
8399
with TestClient(app) as client:
84100
response = client.delete("/robotframework/logs/not_existing")
85101
self.assertEqual(404, response.status_code)
86-
self.assertEqual("The logs not_existing not existing or being generating", response.text)
102+
self.assertEqual(
103+
"The logs not_existing not existing or being generating", response.text
104+
)
87105

88106
run_response = client.get("/robotframework/run/anotherTask")
89107
execution_id = run_response.headers["x-request-id"]

0 commit comments

Comments
 (0)