File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ import time
2
+
3
+
4
+ def test_model_run (client , configured_project_with_label , rand_gen ):
5
+ project = configured_project_with_label
6
+ ontology = project .ontology ()
7
+ data = {"name" : rand_gen (str ), "ontology_id" : ontology .uid }
8
+ model = client .create_model (data ["name" ], data ["ontology_id" ])
9
+
10
+ name = rand_gen (str )
11
+ model_run = model .create_model_run (name )
12
+ assert model_run .name == name
13
+ assert model_run .model_id == model .uid
14
+ # TODO: Uncomment this out once https://github.com/Labelbox/labelbox-python/pull/189 is merged.
15
+ #assert model_run.created_by_id == client.get_user(
16
+ #).uid
17
+
18
+ label = list (project .labels ())[0 ]
19
+ model_run .upsert_labels ([label .uid ])
20
+ time .sleep (3 )
21
+
22
+ annotation_group = next (model_run .annotation_groups ())
23
+ assert annotation_group .label_id == label .uid
24
+ assert annotation_group .model_run_id == model_run .uid
25
+ assert annotation_group .data_row ().uid == next (
26
+ next (project .datasets ()).data_rows ()).uid
You can’t perform that action at this time.
0 commit comments