20 lines
603 B
Python
20 lines
603 B
Python
import pytest
|
|
|
|
from app.domain.cdek_polling import TERMINAL_ORDER_STATUSES, is_terminal_order_status
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"code", sorted(TERMINAL_ORDER_STATUSES)
|
|
)
|
|
def test_terminal_statuses_are_terminal(code: str) -> None:
|
|
assert is_terminal_order_status(code) is True
|
|
|
|
|
|
@pytest.mark.parametrize("code", ["ACCEPTED", "CREATED", "RECEIVED_AT_SHIPMENT_WAREHOUSE", ""])
|
|
def test_non_terminal_statuses_are_not_terminal(code: str) -> None:
|
|
assert is_terminal_order_status(code) is False
|
|
|
|
|
|
def test_none_status_is_not_terminal() -> None:
|
|
assert is_terminal_order_status(None) is False
|