File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import json
33from pathlib import Path
44from unittest .mock import patch
5+ import pytest
56
67from converter .cisu .resources_status .resources_status_converter import (
78 ResourcesStatusConverter ,
@@ -109,3 +110,21 @@ def test_from_rs_to_cisu_no_rs_ri():
109110 ):
110111 result = ResourcesStatusConverter .from_rs_to_cisu (rs_sr_new )
111112 assert result == []
113+
114+
115+ def test_from_rs_to_cisu_resource_not_in_rs_ri ():
116+ unknown_resource_id = "fr.fire.sis076.cgo-076.resource.UNKNOWN_VLM"
117+ rs_sr = make_rs_sr (_CASE_ID , unknown_resource_id , "ARRIVEE" )
118+ rs_ri = make_rs_ri (_CASE_ID ) # RS-RI only has VLM1 and VLM2
119+
120+ with (
121+ patch (
122+ "converter.cisu.resources_status.resources_status_converter.get_last_rs_ri_by_case_id" ,
123+ return_value = persisted (rs_ri ),
124+ ),
125+ pytest .raises (
126+ ValueError ,
127+ match = f"Resource '{ unknown_resource_id } ' from RS-SR not found in RS-RI for caseId '{ _CASE_ID } '" ,
128+ ),
129+ ):
130+ ResourcesStatusConverter .from_rs_to_cisu (rs_sr )
You can’t perform that action at this time.
0 commit comments