Commit Graph

17 Commits

Author SHA1 Message Date
Gustavo Henrique Santos Souza de Miranda 2b79b08df0 Fix all the Ruff errors 2025-07-24 20:19:09 -03:00
Gustavo Henrique Santos Souza de Miranda cc95ce669f Merge remote-tracking branch 'origin/test/entryservice-unit-test' into test/entryservice-unit-test
# Conflicts:
#	tests/service/test_entry_service.py
2025-07-20 23:16:48 -03:00
Gustavo Henrique Santos Souza de Miranda d36ff829db Remove the shared fixtures that are available on conftest.py 2025-07-20 23:15:08 -03:00
Gustavo Henrique Santos Souza de Miranda 0173465943 Add all tests to test the delete of entries 2025-07-20 23:13:46 -03:00
Gustavo Henrique Santos Souza de Miranda 5b9a5bfe24 Add all tests to test the read of entries 2025-07-20 23:13:46 -03:00
Gustavo Henrique Santos Souza de Miranda 95a3a13ee2 Add all tests to test the update of entries 2025-07-20 23:13:46 -03:00
Gustavo Henrique Santos Souza de Miranda f9fb660d7c Add a test to test the creation of entries with null on nullable fields 2025-07-20 23:13:45 -03:00
Gustavo Henrique Santos Souza de Miranda f7a7289b5e test(entry_service): add test for creating an entry without photos
This commit adds a unit test to ensure that the EntryService's
`create` method correctly handles cases where an empty list of photos
is provided.

It verifies that the entry is created successfully and that the
`photos` relationship is an empty list, confirming the feature's
flexibility.
2025-07-20 23:13:45 -03:00
Gustavo Henrique Santos Souza de Miranda 0227879bb3 test(entry_service): add a failure case test for create method
This commit adds a unit test for an important "unhappy path" in the
EntryService's `create` method.

It specifically verifies that the method gracefully returns `None`
when provided with a `travel_diary_id` that does not exist in the
database, ensuring the initial guard clause works as expected.
2025-07-20 23:13:45 -03:00
Gustavo Henrique Santos Souza de Miranda e46f02cc39 test(entry_service): add unit test for creating a new entry
This commit introduces the first unit test for the EntryService,
covering the "happy path" for the `create` method.

It verifies that a new entry is correctly persisted to the database,
including its relationship with associated Photo objects. The test
leverages fixtures to create an isolated, in-memory database
populated with the necessary dependencies.
2025-07-20 23:13:45 -03:00
Gustavo Henrique Santos Souza de Miranda 1629b9d52c Add all tests to test the delete of entries 2025-07-20 22:38:55 -03:00
Gustavo Henrique Santos Souza de Miranda 790a9ea3f0 Add all tests to test the read of entries 2025-07-20 22:26:40 -03:00
Gustavo Henrique Santos Souza de Miranda cec1827635 Add all tests to test the update of entries 2025-07-20 22:12:09 -03:00
Gustavo Henrique Santos Souza de Miranda 1c8026620c Add a test to test the creation of entries with null on nullable fields 2025-07-20 20:47:12 -03:00
Gustavo Henrique Santos Souza de Miranda 77e191f480 test(entry_service): add test for creating an entry without photos
This commit adds a unit test to ensure that the EntryService's
`create` method correctly handles cases where an empty list of photos
is provided.

It verifies that the entry is created successfully and that the
`photos` relationship is an empty list, confirming the feature's
flexibility.
2025-07-20 16:03:45 -03:00
Gustavo Henrique Santos Souza de Miranda 3c7925cb1c test(entry_service): add a failure case test for create method
This commit adds a unit test for an important "unhappy path" in the
EntryService's `create` method.

It specifically verifies that the method gracefully returns `None`
when provided with a `travel_diary_id` that does not exist in the
database, ensuring the initial guard clause works as expected.
2025-07-20 15:21:49 -03:00
Gustavo Henrique Santos Souza de Miranda c4dceda942 test(entry_service): add unit test for creating a new entry
This commit introduces the first unit test for the EntryService,
covering the "happy path" for the `create` method.

It verifies that a new entry is correctly persisted to the database,
including its relationship with associated Photo objects. The test
leverages fixtures to create an isolated, in-memory database
populated with the necessary dependencies.
2025-07-20 03:35:22 -03:00