File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
time_tracker/time_entries
_application/_time_entries Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 11.PHONY : help
22help :
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
2020test : export ENVIRONMENT = test
21- test : export TEST_DB_CONNECTION = sqlite:///file:memory?mode=memory&cache=shared&uri=true
2221test :
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
Original file line number Diff line number Diff line change @@ -54,9 +54,8 @@ def create_time_entry(req: func.HttpRequest) -> func.HttpResponse:
5454
5555
5656def _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'
Original file line number Diff line number Diff line change 11from dataclasses import dataclass
2- from typing import List
2+ from typing import List , Optional
33
44
55@dataclass (frozen = True )
66class 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
You can’t perform that action at this time.
0 commit comments