Skip to content

Commit

Permalink
Add test, accept empty list for entregas, but not null
Browse files Browse the repository at this point in the history
  • Loading branch information
augusto-herrmann committed Feb 12, 2025
1 parent cece68f commit ee2bd29
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/plano_entregas/core_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,29 @@ def test_create_plano_entregas_int_out_of_range(
else:
assert response.status_code == http_status.HTTP_422_UNPROCESSABLE_ENTITY

@pytest.mark.parametrize(
"entregas",
[
([]),
None,
]
)
def test_create_plano_entregas_sem_entregas(
self,
entregas
):
"""Cria um plano de entregas que não contém entregas."""
input_pe = deepcopy(self.input_pe)
input_pe["entregas"] = entregas

response = self.put_plano_entregas(input_pe)

if isinstance(entregas, list):
# aceita lista vazia
assert response.status_code == http_status.HTTP_201_CREATED
else:
assert response.status_code == http_status.HTTP_422_UNPROCESSABLE_ENTITY


class TestGetPlanoEntregas(BasePETest):
"""Testes para a busca de Planos de Entregas."""
Expand Down

0 comments on commit ee2bd29

Please sign in to comment.