Skip to content

Commit 3658c9f

Browse files
committed
fix: TT-401 resolved comments
1 parent 42c4683 commit 3658c9f

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

V2/Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.PHONY: help
22
help:
33
@echo "---------------HELP-----------------"
4-
@echo "To install the dependencies type make install"
5-
@echo "To test the project type make test"
6-
@echo "To test a specific test of the project make test specific_test=name of test"
7-
@echo "To run the local database type make start-local"
8-
@echo "To run all comands type make ci"
4+
@echo "- make install --> Install the dependencies"
5+
@echo "- make test --> Run all tests"
6+
@echo "- make test specific_test=<name_of_the_test> --> Run specific test"
7+
@echo "- make start-local --> Run local database"
8+
@echo "- make ci --> Install the dependencies and run all tests"
99
@echo "------------------------------------"
1010

1111
.PHONY: install
@@ -18,14 +18,13 @@ install:
1818

1919
.PHONY: test
2020
test: export ENVIRONMENT = test
21-
test: export TEST_DB_CONNECTION = sqlite:///file:memory?mode=memory&cache=shared&uri=true
2221
test:
2322
@echo "=========================================Lint with flake8========================================="
2423
flake8 . --show-source --statistics
2524
@echo "Completed flake8!"
2625
@echo "=========================================Test with pytest========================================="
2726
@if [ "$(specific_test)" ]; then \
28-
python -m pytest -v -k $(specific_test);\
27+
python -m pytest -vv -s -k $(specific_test);\
2928
else \
3029
python -m pytest -v;\
3130
fi

V2/time_tracker/time_entries/_application/_time_entries/_create_time_entry.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ def create_time_entry(req: func.HttpRequest) -> func.HttpResponse:
5454

5555

5656
def _validate_time_entry(time_entry_data: dict) -> typing.List[str]:
57-
time_entry_fields = [field.name for field in dataclasses.fields(_domain.TimeEntry)]
58-
time_entry_fields.pop(8)
59-
time_entry_fields.pop(0)
57+
time_entry_fields = [field.name for field in dataclasses.fields(_domain.TimeEntry)
58+
if field.type != typing.Optional[field.type]]
6059
missing_keys = [field for field in time_entry_fields if field not in time_entry_data]
6160
return [
6261
f'The {missing_key} key is missing in the input data'
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
from dataclasses import dataclass
2-
from typing import List
2+
from typing import List, Optional
33

44

55
@dataclass(frozen=True)
66
class TimeEntry:
7-
id: int
7+
id: Optional[int]
88
start_date: str
99
owner_id: int
1010
description: str
1111
activity_id: int
1212
uri: str
1313
technologies: List[str]
1414
end_date: str
15-
deleted: bool
15+
deleted: Optional[bool]
1616
timezone_offset: str
1717
project_id: int

0 commit comments

Comments
 (0)