Skip to content

Commit 2d7ac80

Browse files
author
Matt Sokoloff
committed
add missing test
1 parent 2753c10 commit 2d7ac80

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/integration/test_model_run.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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

0 commit comments

Comments
 (0)