Skip to content

Commit bd3debe

Browse files
netr0mnetr0m
authored andcommitted
fix: resolve PR feedback
1 parent f3db74a commit bd3debe

File tree

21 files changed

+62
-64
lines changed

21 files changed

+62
-64
lines changed

api/src/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
description_md = """
2020
### Description
21-
A RESTful API for handling todos items.
21+
A RESTful API for handling todo items.
2222
2323
Anyone in Equinor are authorized to run these calculations.
2424
* Click **Authorize** to login and start testing.

api/src/tests/unit/data_providers/repositories/test_TodoRepository.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,52 @@ def _setup_repository(self, test_client: MongoDatabaseClient):
1212
self.repository = TodoRepository(client=test_client)
1313

1414
def test_create(self):
15-
todo_item = TodoItem(id="1234", title="todos 1")
15+
todo_item = TodoItem(id="1234", title="todo 1")
1616
self.repository.create(todo_item)
1717
assert len(self.repository.get_all()) == 1
1818

1919
def test_create_already_exists(self):
20-
todo_item_1 = TodoItem(id="1234", title="todos 1")
20+
todo_item_1 = TodoItem(id="1234", title="todo 1")
2121
self.repository.create(todo_item_1)
2222
with pytest.raises(ValidationException):
23-
todo_item_2 = TodoItem(id="1234", title="todos 1")
23+
todo_item_2 = TodoItem(id="1234", title="todo 1")
2424
self.repository.create(todo_item_2)
2525

2626
def test_find_item_that_exist(self):
2727
documents = [
28-
{"_id": "81549300", "title": "todos 1"},
29-
{"_id": "1a2b", "title": "todos 2"},
30-
{"_id": "987321", "title": "todos 3"},
28+
{"_id": "81549300", "title": "todo 1"},
29+
{"_id": "1a2b", "title": "todo 2"},
30+
{"_id": "987321", "title": "todo 3"},
3131
{
3232
"_id": "987456",
33-
"title": "todos 4",
33+
"title": "todo 4",
3434
},
3535
]
3636
self.repository.client.insert_many(documents)
37-
todo_item = self.repository.find_one({"title": "todos 2"})
37+
todo_item = self.repository.find_one({"title": "todo 2"})
3838
assert todo_item.id == "1a2b"
3939

4040
def test_find_item_that_does_not_exist(self):
4141
documents = [
42-
{"_id": "81549300", "title": "todos 1"},
43-
{"_id": "1a2b", "title": "todos 2"},
44-
{"_id": "987321", "title": "todos 3"},
42+
{"_id": "81549300", "title": "todo 1"},
43+
{"_id": "1a2b", "title": "todo 2"},
44+
{"_id": "987321", "title": "todo 3"},
4545
{
4646
"_id": "987456",
47-
"title": "todos 4",
47+
"title": "todo 4",
4848
},
4949
]
5050
self.repository.client.insert_many(documents)
5151
assert self.repository.find_one({"_id": "invalid"}) is None
5252

5353
def test_get_item_that_does_exist(self):
5454
documents = [
55-
{"_id": "81549300", "title": "todos 1"},
56-
{"_id": "1a2b", "title": "todos 2"},
57-
{"_id": "987321", "title": "todos 3"},
55+
{"_id": "81549300", "title": "todo 1"},
56+
{"_id": "1a2b", "title": "todo 2"},
57+
{"_id": "987321", "title": "todo 3"},
5858
{
5959
"_id": "987456",
60-
"title": "todos 4",
60+
"title": "todo 4",
6161
},
6262
]
6363
self.repository.client.insert_many(documents)
@@ -66,20 +66,20 @@ def test_get_item_that_does_exist(self):
6666

6767
def test_get_item_that_does_not_exist(self):
6868
documents = [
69-
{"_id": "81549300", "title": "todos 1"},
70-
{"_id": "1a2b", "title": "todos 2"},
71-
{"_id": "987321", "title": "todos 3"},
69+
{"_id": "81549300", "title": "todo 1"},
70+
{"_id": "1a2b", "title": "todo 2"},
71+
{"_id": "987321", "title": "todo 3"},
7272
{
7373
"_id": "987456",
74-
"title": "todos 4",
74+
"title": "todo 4",
7575
},
7676
]
7777
self.repository.client.insert_many(documents)
7878
with pytest.raises(NotFoundException):
7979
self.repository.get("invalid")
8080

8181
def test_update_item(self):
82-
todo_item = TodoItem(id="81549300", title="todos 1")
82+
todo_item = TodoItem(id="81549300", title="todo 1")
8383
self.repository.create(todo_item)
8484
todo_item_to_update = TodoItem(id="81549300", title="Updated title")
8585
self.repository.update(todo_item=todo_item_to_update)
@@ -91,15 +91,15 @@ def test_update_item_that_does_not_exist(self):
9191
self.repository.update(todo_item_to_update)
9292

9393
def test_delete(self):
94-
documents = [{"_id": "81549300", "title": "todos 1"}, {"_id": "1a2b", "title": "todos 2"}]
94+
documents = [{"_id": "81549300", "title": "todo 1"}, {"_id": "1a2b", "title": "todo 2"}]
9595
self.repository.client.insert_many(documents)
9696
assert len(self.repository.get_all()) == 2
9797
self.repository.delete("81549300")
9898
assert len(self.repository.get_all()) == 1
9999
assert self.repository.get_all() == [self.repository.get("1a2b")]
100100

101101
def test_delete_all(self):
102-
documents = [{"_id": "81549300", "title": "todos 1"}, {"_id": "1a2b", "title": "todos 2"}]
102+
documents = [{"_id": "81549300", "title": "todo 1"}, {"_id": "1a2b", "title": "todo 2"}]
103103
self.repository.client.insert_many(documents)
104104
assert len(self.repository.get_all()) == 2
105105
self.repository.delete_all()

api/src/tests/unit/features/todo/use_cases/test_update_todo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from features.todo.use_cases.update_todo import UpdateTodoRequest, update_todo_use_case
55

66

7-
def test_update_todos_should_return_success(todo_repository: TodoRepositoryInterface):
7+
def test_update_todo_should_return_success(todo_repository: TodoRepositoryInterface):
88
id = "dh2109"
99
data = UpdateTodoRequest(title="new title", is_completed=False)
1010
result = update_todo_use_case(id, data, todo_repository=todo_repository)

api/src/tests/yarn.lock

Lines changed: 0 additions & 4 deletions
This file was deleted.

web/src/api/generated/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/* eslint-disable */
33
/**
44
* Template FastAPI React
5-
* ### Description A RESTful API for handling todos items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the service with new simulations, create issue on Github.
5+
* ### Description A RESTful API for handling todo items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the API, create issue on Github or see docs.
66
*
7-
* The version of the OpenAPI document: 0.1.0
7+
* The version of the OpenAPI document: 1.1.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

web/src/api/generated/api/health-check-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/* eslint-disable */
33
/**
44
* Template FastAPI React
5-
* ### Description A RESTful API for handling todos items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the service with new simulations, create issue on Github.
5+
* ### Description A RESTful API for handling todo items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the API, create issue on Github or see docs.
66
*
7-
* The version of the OpenAPI document: 0.1.0
7+
* The version of the OpenAPI document: 1.1.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

web/src/api/generated/api/todos-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/* eslint-disable */
33
/**
44
* Template FastAPI React
5-
* ### Description A RESTful API for handling todos items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the service with new simulations, create issue on Github.
5+
* ### Description A RESTful API for handling todo items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the API, create issue on Github or see docs.
66
*
7-
* The version of the OpenAPI document: 0.1.0
7+
* The version of the OpenAPI document: 1.1.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

web/src/api/generated/api/whoami-api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/* eslint-disable */
33
/**
44
* Template FastAPI React
5-
* ### Description A RESTful API for handling todos items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the service with new simulations, create issue on Github.
5+
* ### Description A RESTful API for handling todo items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the API, create issue on Github or see docs.
66
*
7-
* The version of the OpenAPI document: 0.1.0
7+
* The version of the OpenAPI document: 1.1.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -35,7 +35,7 @@ export const WhoamiApiAxiosParamCreator = function (configuration?: Configuratio
3535
* @throws {RequiredError}
3636
*/
3737
whoami: async (options: any = {}): Promise<RequestArgs> => {
38-
const localVarPath = `/whoami/`;
38+
const localVarPath = `/whoami`;
3939
// use dummy base URL string because the URL constructor only accepts absolute URLs.
4040
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4141
let baseOptions;

web/src/api/generated/base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/* eslint-disable */
33
/**
44
* Template FastAPI React
5-
* ### Description A RESTful API for handling todos items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the service with new simulations, create issue on Github.
5+
* ### Description A RESTful API for handling todo items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the API, create issue on Github or see docs.
66
*
7-
* The version of the OpenAPI document: 0.1.0
7+
* The version of the OpenAPI document: 1.1.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

web/src/api/generated/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/* eslint-disable */
33
/**
44
* Template FastAPI React
5-
* ### Description A RESTful API for handling todos items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the service with new simulations, create issue on Github.
5+
* ### Description A RESTful API for handling todo items. Anyone in Equinor are authorized to run these calculations. * Click **Authorize** to login and start testing. ### Resources * [Docs](https://equinor.github.io/template-fastapi-react/) * [Github](https://github.com/equinor/template-fastapi-react) For questions about usage or expanding the API, create issue on Github or see docs.
66
*
7-
* The version of the OpenAPI document: 0.1.0
7+
* The version of the OpenAPI document: 1.1.0
88
*
99
*
1010
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

0 commit comments

Comments
 (0)