@@ -199,25 +199,38 @@ def test_create_drf_capture_201(self) -> None:
199199 return_value = self .drf_capture .index_name ,
200200 ),
201201 ):
202- response = self .client .post (
202+ response_raw = self .client .post (
203203 self .list_url ,
204204 data = {
205205 "capture_type" : CaptureType .DigitalRF ,
206206 "channel" : unique_channel ,
207207 "top_level_dir" : unique_top_level_dir ,
208208 },
209209 )
210- assert response .status_code == status .HTTP_201_CREATED
211- assert response .json ()["capture_props" ] == self .drf_metadata
212- assert response .json ()["channel" ] == unique_channel
213- assert response .json ()["top_level_dir" ] == unique_top_level_dir
214- assert response .json ()["capture_type" ] == CaptureType .DigitalRF
210+ assert response_raw .status_code == status .HTTP_201_CREATED , (
211+ f"Status { response_raw .status_code } != { status .HTTP_201_CREATED } "
212+ )
213+ response = response_raw .json ()
214+ assert response ["capture_props" ] == self .drf_metadata , (
215+ f"Props { response ['capture_props' ]} != { self .drf_metadata } "
216+ )
217+ assert response ["channel" ] == unique_channel , (
218+ f"Channel { response ['channel' ]} != { unique_channel } "
219+ )
220+ assert response ["top_level_dir" ] == "/" + unique_top_level_dir , (
221+ "Gateway should normalize to an absolute path: "
222+ f"{ response ['top_level_dir' ]} "
223+ )
224+ assert response ["capture_type" ] == CaptureType .DigitalRF , (
225+ f"Capture type: { response ['capture_type' ]} != { CaptureType .DigitalRF } "
226+ )
215227
216228 def test_create_rh_capture_201 (self ) -> None :
217229 """Test creating rh capture returns metadata."""
218230 unique_scan_group = uuid .uuid4 ()
219231 unique_rh_metadata = self .rh_metadata .copy ()
220232 unique_rh_metadata ["scan_group" ] = str (unique_scan_group )
233+ test_dir_rh = "test-dir-rh"
221234
222235 with (
223236 patch (
@@ -242,7 +255,7 @@ def test_create_rh_capture_201(self) -> None:
242255 data = {
243256 "capture_type" : CaptureType .RadioHound ,
244257 "scan_group" : str (unique_scan_group ),
245- "top_level_dir" : "test-dir-rh" ,
258+ "top_level_dir" : test_dir_rh ,
246259 },
247260 )
248261 assert response_raw .status_code == status .HTTP_201_CREATED , (
@@ -253,13 +266,13 @@ def test_create_rh_capture_201(self) -> None:
253266 unique_scan_group ,
254267 ), f"Unexpected scan group: { response ['scan_group' ]} "
255268 assert response ["capture_props" ] == unique_rh_metadata , (
256- f"Unexpected metadata: { response ['capture_props' ]} "
269+ f"{ response ['capture_props' ]} != { unique_rh_metadata } "
257270 )
258271 assert response ["capture_type" ] == CaptureType .RadioHound , (
259- f"Unexpected capture type: { response ['capture_type' ]} "
272+ f"{ response ['capture_type' ]} != { CaptureType . RadioHound } "
260273 )
261- assert response ["top_level_dir" ] == "test-dir-rh" , (
262- f"Unexpected top level dir : { response ['top_level_dir' ]} "
274+ assert response ["top_level_dir" ] == "/" + test_dir_rh , (
275+ f"Expected Gateway to normalize the path : { response ['top_level_dir' ]} "
263276 )
264277
265278 def test_create_drf_capture_already_exists (self ) -> None :
0 commit comments