Skip to content

Commit 51a62c7

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 4adc369 commit 51a62c7

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
@@ -3,6 +3,7 @@
33
import pytest
44
from pathlib import Path
55
from unittest.mock import patch
6+
import pytest
67

78
from converter.cisu.resources_status.resources_status_converter import (
89
ResourcesStatusConverter,
@@ -110,3 +111,21 @@ def test_from_rs_to_cisu_no_rs_ri():
110111
):
111112
with pytest.raises(ValueError, match="No RS-RI found for caseId"):
112113
ResourcesStatusConverter.from_rs_to_cisu(rs_sr_new)
114+
115+
116+
def test_from_rs_to_cisu_resource_not_in_rs_ri():
117+
unknown_resource_id = "fr.fire.sis076.cgo-076.resource.UNKNOWN_VLM"
118+
rs_sr = make_rs_sr(_CASE_ID, unknown_resource_id, "ARRIVEE")
119+
rs_ri = make_rs_ri(_CASE_ID) # RS-RI only has VLM1 and VLM2
120+
121+
with (
122+
patch(
123+
"converter.cisu.resources_status.resources_status_converter.get_last_rs_ri_by_case_id",
124+
return_value=persisted(rs_ri),
125+
),
126+
pytest.raises(
127+
ValueError,
128+
match=f"Resource '{unknown_resource_id}' from RS-SR not found in RS-RI for caseId '{_CASE_ID}'",
129+
),
130+
):
131+
ResourcesStatusConverter.from_rs_to_cisu(rs_sr)

0 commit comments

Comments
 (0)