Skip to content

Commit 253be2c

Browse files
author
Issam Kadar
committed
feat/converter : add test that assert raise error when rs-sr with unknown resourceId in persisted rs-ri
1 parent 9d8f847 commit 253be2c

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

converter/tests/cisu/test_resources_status_converter.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pytest
22
from unittest.mock import patch
3+
import pytest
34

45
from converter.cisu.resources_status.resources_status_converter import (
56
ResourcesStatusConverter,
@@ -75,3 +76,21 @@ def test_from_rs_to_cisu_no_rs_ri():
7576
):
7677
with pytest.raises(ValueError, match="No RS-RI found for caseId"):
7778
ResourcesStatusConverter.from_rs_to_cisu(rs_sr_new)
79+
80+
81+
def test_from_rs_to_cisu_resource_not_in_rs_ri():
82+
unknown_resource_id = "fr.fire.sis076.cgo-076.resource.UNKNOWN_VLM"
83+
rs_sr = make_rs_sr(_CASE_ID, unknown_resource_id, "ARRIVEE")
84+
rs_ri = make_rs_ri(_CASE_ID) # RS-RI only has VLM1 and VLM2
85+
86+
with (
87+
patch(
88+
"converter.cisu.resources_status.resources_status_converter.get_last_rs_ri_by_case_id",
89+
return_value=persisted(rs_ri),
90+
),
91+
pytest.raises(
92+
ValueError,
93+
match=f"Resource '{unknown_resource_id}' from RS-SR not found in RS-RI for caseId '{_CASE_ID}'",
94+
),
95+
):
96+
ResourcesStatusConverter.from_rs_to_cisu(rs_sr)

0 commit comments

Comments
 (0)