File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import pytest
44from pathlib import Path
55from unittest .mock import patch
6+ import pytest
67
78from 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 )
You can’t perform that action at this time.
0 commit comments