@@ -220,9 +220,14 @@ def test_offline_tags(create_plain_run_offline: tuple[sv_run.Run, dict]) -> None
220
220
221
221
@pytest .mark .run
222
222
def test_update_metadata_running (create_test_run : tuple [sv_run .Run , dict ]) -> None :
223
- METADATA = {"a" : 10 , "b" : 1.2 , "c" : "word" }
223
+ METADATA = {"a" : 1 , "b" : 1.2 , "c" : "word" , "d" : "new " }
224
224
run , _ = create_test_run
225
- run .update_metadata (METADATA )
225
+ # Add an initial set of metadata
226
+ run .update_metadata ({"a" : 10 , "b" : 1.2 , "c" : "word" })
227
+ # Try updating a second time, check original dict isnt overwritten
228
+ run .update_metadata ({"d" : "new" })
229
+ # Try updating an already defined piece of metadata
230
+ run .update_metadata ({"a" : 1 })
226
231
run .close ()
227
232
time .sleep (1.0 )
228
233
client = sv_cl .Client ()
@@ -234,9 +239,14 @@ def test_update_metadata_running(create_test_run: tuple[sv_run.Run, dict]) -> No
234
239
235
240
@pytest .mark .run
236
241
def test_update_metadata_created (create_pending_run : tuple [sv_run .Run , dict ]) -> None :
237
- METADATA = {"a" : 10 , "b" : 1.2 , "c" : "word" }
242
+ METADATA = {"a" : 1 , "b" : 1.2 , "c" : "word" , "d" : "new " }
238
243
run , _ = create_pending_run
239
- run .update_metadata (METADATA )
244
+ # Add an initial set of metadata
245
+ run .update_metadata ({"a" : 10 , "b" : 1.2 , "c" : "word" })
246
+ # Try updating a second time, check original dict isnt overwritten
247
+ run .update_metadata ({"d" : "new" })
248
+ # Try updating an already defined piece of metadata
249
+ run .update_metadata ({"a" : 1 })
240
250
time .sleep (1.0 )
241
251
client = sv_cl .Client ()
242
252
run_info = client .get_run (run .id )
@@ -250,13 +260,20 @@ def test_update_metadata_created(create_pending_run: tuple[sv_run.Run, dict]) ->
250
260
def test_update_metadata_offline (
251
261
create_plain_run_offline : tuple [sv_run .Run , dict ],
252
262
) -> None :
253
- METADATA = {"a" : 10 , "b" : 1.2 , "c" : "word" }
263
+ METADATA = {"a" : 1 , "b" : 1.2 , "c" : "word" , "d" : "new " }
254
264
run , _ = create_plain_run_offline
255
265
run_name = run ._name
256
- run .update_metadata (METADATA )
266
+ # Add an initial set of metadata
267
+ run .update_metadata ({"a" : 10 , "b" : 1.2 , "c" : "word" })
268
+ # Try updating a second time, check original dict isnt overwritten
269
+ run .update_metadata ({"d" : "new" })
270
+ # Try updating an already defined piece of metadata
271
+ run .update_metadata ({"a" : 1 })
272
+
257
273
sv_send .sender (os .environ ["SIMVUE_OFFLINE_DIRECTORY" ], 2 , 10 )
258
274
run .close ()
259
275
time .sleep (1.0 )
276
+
260
277
client = sv_cl .Client ()
261
278
run_info = client .get_run (client .get_run_id_from_name (run_name ))
262
279
@@ -655,6 +672,29 @@ def test_update_tags_created(
655
672
assert sorted (run_data .tags ) == sorted (tags + ["additional" ])
656
673
657
674
675
+ @pytest .mark .offline
676
+ @pytest .mark .run
677
+ def test_update_tags_offline (
678
+ create_plain_run_offline : typing .Tuple [sv_run .Run , dict ],
679
+ ) -> None :
680
+ simvue_run , _ = create_plain_run_offline
681
+ run_name = simvue_run ._name
682
+
683
+ simvue_run .set_tags (["simvue_client_unit_tests" ,])
684
+
685
+ simvue_run .update_tags (["additional" ])
686
+
687
+ sv_send .sender (os .environ ["SIMVUE_OFFLINE_DIRECTORY" ], 2 , 10 )
688
+ simvue_run .close ()
689
+ time .sleep (1.0 )
690
+
691
+ client = sv_cl .Client ()
692
+ run_data = client .get_run (client .get_run_id_from_name (run_name ))
693
+
694
+ time .sleep (1 )
695
+ run_data = client .get_run (simvue_run ._id )
696
+ assert sorted (run_data .tags ) == sorted (["simvue_client_unit_tests" , "additional" ])
697
+
658
698
@pytest .mark .run
659
699
@pytest .mark .parametrize ("object_type" , ("DataFrame" , "ndarray" ))
660
700
def test_save_object (
0 commit comments