Skip to content

Commit 8c33fd0

Browse files
author
Matt Sokoloff
committed
fix tests
1 parent 90fbd4e commit 8c33fd0

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

labelbox/schema/model.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@ class Model(DbObject):
88
can make predictions on new data.
99
Attributes:
1010
name (str)
11-
ontology (Relationship): `ToOne` relationship to Ontology
12-
model_runs (Relationship): `ToMany` relationship to ModelRun (TODO)
13-
slices (Relationship): `ToMany` relationship to Slice (TODO)
11+
model_runs (Relationship): `ToMany` relationship to ModelRun
1412
"""
1513

1614
name = Field.String("name")
17-
1815
model_runs = Relationship.ToMany("ModelRun", False)
19-
ontology = Relationship.ToOne("Ontology", False)
16+
2017

2118
def create_model_run(self, name):
2219
""" Creates a model run belonging to this model.

tests/integration/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from random import randint
77
from string import ascii_letters
88
from types import SimpleNamespace
9+
import time
910
import uuid
1011
import os
1112
import re
@@ -333,6 +334,7 @@ def configured_project_with_label(client, rand_gen, annotation_submit_fn):
333334
upload_task = MALPredictionImport.create_from_objects(
334335
client, project.uid, f'mal-import-{uuid.uuid4()}', predictions)
335336
upload_task.wait_until_done()
337+
time.sleep(1)
336338
annotation_submit_fn(project.uid, data_row.uid)
337339
yield project
338340
dataset.delete()

tests/integration/test_model.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ def test_model(client, configured_project, rand_gen):
1111
data = {"name": rand_gen(str), "ontology_id": ontology.uid}
1212
model = client.create_model(data["name"], data["ontology_id"])
1313
assert model.name == data["name"]
14-
assert model.ontology().uid == data["ontology_id"]
1514

1615
after = list(client.get_models())
1716
assert len(after) == len(before) + 1
1817
assert model in after
1918

2019
model = client.get_model(model.uid)
2120
assert model.name == data["name"]
22-
assert model.ontology().uid == data["ontology_id"]

tests/integration/test_model_run.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ def test_model_run(client, configured_project_with_label, rand_gen):
1111
model_run = model.create_model_run(name)
1212
assert model_run.name == name
1313
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
14+
assert model_run.created_by_id == client.get_user(
15+
).uid
1716

1817
label = list(project.labels())[0]
1918
model_run.upsert_labels([label.uid])

0 commit comments

Comments
 (0)