File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import pytest
22from unittest .mock import patch
3+ import pytest
34
45from 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 )
You can’t perform that action at this time.
0 commit comments