@@ -75,7 +75,7 @@ def test_invalid_block_type(admin_client, default_sample_dict):
75
75
},
76
76
)
77
77
78
- assert response .status_code == 400
78
+ assert response .status_code == 501
79
79
assert "Invalid block type" in response .json ["message" ]
80
80
81
81
@@ -259,7 +259,9 @@ def test_xrd_block_lifecycle(admin_client, default_sample_dict):
259
259
assert "bokeh_plot_data" in web_block
260
260
assert "processed_data" in web_block
261
261
assert "peak_data" in web_block ["processed_data" ]
262
- assert web_block .get ("errors" , []) == []
262
+ assert "file_id" in web_block
263
+ assert web_block ["file_id" ] == file_id
264
+ assert web_block .get ("errors" ) is None
263
265
264
266
block = XRDBlock .from_web (web_block )
265
267
db = block .to_db ()
@@ -306,7 +308,7 @@ def test_comment_block_manipulation(admin_client, default_sample_dict, database)
306
308
assert response .json ["new_block_data" ]["blocktype" ] == block_type
307
309
assert response .json ["new_block_data" ]["freeform_comment" ] == "This is a test comment block."
308
310
assert response .json ["new_block_data" ]["title" ] == "Test Comment Block"
309
- assert "errors" not in response .json ["new_block_data" ]
311
+ assert response .json ["new_block_data" ]. get ( "errors" ) is None
310
312
311
313
# Check that this result was actually stored
312
314
response = admin_client .get (f"/get-item-data/{ sample_id } " )
@@ -319,7 +321,7 @@ def test_comment_block_manipulation(admin_client, default_sample_dict, database)
319
321
assert "errors" not in response .json ["item_data" ]["blocks_obj" ][block_id ]
320
322
321
323
# Try to add some bad data
322
- block_data ["bokeh_plot_data" ] = ' {"bokeh": "json"}'
324
+ block_data ["bokeh_plot_data" ] = {"bokeh" : "json" }
323
325
block_data ["random_new_key" ] = "test new key"
324
326
response = admin_client .post ("/update-block/" , json = {"block_data" : block_data })
325
327
assert response .status_code == 200
@@ -419,7 +421,7 @@ def test_create_sample_with_example_files(
419
421
if block_type == "xrd" :
420
422
assert response .json ["new_block_data" ]["processed_data" ]["peak_data" ] is not None
421
423
422
- response = admin_client .get (f"/get-item-data/{ sample_id } ?load_blocks=1 " )
424
+ response = admin_client .get (f"/get-item-data/{ sample_id } " )
423
425
assert response .status_code == 200
424
426
assert response .json ["status" ] == "success"
425
427
0 commit comments