Skip to content

Commit e459875

Browse files
committed
adjusting tests
1 parent bda1afb commit e459875

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

test/integration/test_groundlight.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ def test_binary_detector(gl: Groundlight, detector_name: Callable):
859859
name = detector_name()
860860
created_detector = gl.create_binary_detector(name, "Is there a dog", confidence_threshold=0.0)
861861
assert created_detector is not None
862-
binary_iq = gl.submit_image_query(created_detector, "test/assets/dog.jpeg")
862+
binary_iq = gl.submit_image_query(created_detector, "test/assets/dog.jpeg", wait=0)
863863
assert binary_iq.result.label is not None
864864

865865

@@ -870,7 +870,7 @@ def test_counting_detector(gl: Groundlight, detector_name: Callable):
870870
name = detector_name()
871871
created_detector = gl.create_counting_detector(name, "How many dogs", "dog", confidence_threshold=0.0)
872872
assert created_detector is not None
873-
count_iq = gl.submit_image_query(created_detector, "test/assets/dog.jpeg")
873+
count_iq = gl.submit_image_query(created_detector, "test/assets/dog.jpeg", wait=0)
874874
assert count_iq.result.count is not None
875875

876876

@@ -903,7 +903,7 @@ def test_multiclass_detector(gl: Groundlight, detector_name: Callable):
903903
name, "What kind of dog is this?", class_names=class_names, confidence_threshold=0.0
904904
)
905905
assert created_detector is not None
906-
mc_iq = gl.submit_image_query(created_detector, "test/assets/dog.jpeg")
906+
mc_iq = gl.submit_image_query(created_detector, "test/assets/dog.jpeg", wait=0)
907907
assert mc_iq.result.label is not None
908908
assert mc_iq.result.label in class_names
909909

@@ -928,7 +928,7 @@ def test_delete_detector(gl: Groundlight, detector_name: Callable):
928928
# Create another detector to test deletion by ID string and that an attached image query is deleted
929929
name2 = detector_name("Test delete detector 2")
930930
detector2 = gl.create_detector(name=name2, query=query, pipeline_config=pipeline_config)
931-
gl.submit_image_query(detector2, "test/assets/dog.jpeg")
931+
gl.submit_image_query(detector2, "test/assets/dog.jpeg", wait=0)
932932

933933
time.sleep(10)
934934

test/unit/test_cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ def test_detector_and_image_queries(detector_name: Callable):
8181
"submit-image-query",
8282
det_id_on_create,
8383
"test/assets/cat.jpeg",
84+
"--wait",
85+
"0",
8486
],
8587
stdout=subprocess.PIPE,
8688
stderr=subprocess.PIPE,

test/unit/test_experimental.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_text_recognition_detector(gl_experimental: ExperimentalApi, detector_na
9999
name, "What is the date and time?", confidence_threshold=0.0
100100
)
101101
assert created_detector is not None
102-
mc_iq = gl_experimental.submit_image_query(created_detector, "test/assets/dog.jpeg")
102+
mc_iq = gl_experimental.submit_image_query(created_detector, "test/assets/dog.jpeg", wait=0)
103103
assert mc_iq.result.text is not None
104104

105105

@@ -112,7 +112,7 @@ def test_bounding_box_detector(gl_experimental: ExperimentalApi, detector_name:
112112
name, "Draw a bounding box around each dog in the image", "dog", confidence_threshold=0.0
113113
)
114114
assert created_detector is not None
115-
bbox_iq = gl_experimental.submit_image_query(created_detector, "test/assets/dog.jpeg")
115+
bbox_iq = gl_experimental.submit_image_query(created_detector, "test/assets/dog.jpeg", wait=0)
116116
assert bbox_iq.result.label is not None
117117
assert bbox_iq.rois is not None
118118

test/unit/test_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
def test_get_image(gl_experimental: ExperimentalApi):
88
name = f"Test {datetime.utcnow()}"
99
det = gl_experimental.get_or_create_detector(name, "test_query")
10-
iq = gl_experimental.submit_image_query(det, image="test/assets/dog.jpeg", wait=10)
10+
iq = gl_experimental.submit_image_query(det, image="test/assets/dog.jpeg", wait=0)
1111
gl_experimental.get_image(iq.id)
1212
assert isinstance(PIL.Image.open(gl_experimental.get_image(iq.id)), PIL.Image.Image)

test/unit/test_labels.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
def test_binary_labels(gl_experimental: ExperimentalApi):
88
name = f"Test binary labels{datetime.utcnow()}"
99
det = gl_experimental.create_detector(name, "test_query")
10-
iq1 = gl_experimental.submit_image_query(det, "test/assets/cat.jpeg")
10+
iq1 = gl_experimental.submit_image_query(det, "test/assets/cat.jpeg", wait=0)
1111
gl_experimental.add_label(iq1, "YES")
1212
iq1 = gl_experimental.get_image_query(iq1.id)
1313
assert iq1.result.label == "YES"
@@ -24,7 +24,7 @@ def test_binary_labels(gl_experimental: ExperimentalApi):
2424
def test_counting_labels(gl_experimental: ExperimentalApi):
2525
name = f"Test binary labels{datetime.utcnow()}"
2626
det = gl_experimental.create_counting_detector(name, "test_query", "test_object_class")
27-
iq1 = gl_experimental.submit_image_query(det, "test/assets/cat.jpeg")
27+
iq1 = gl_experimental.submit_image_query(det, "test/assets/cat.jpeg", wait=0)
2828

2929
gl_experimental.add_label(iq1, 0)
3030
iq1 = gl_experimental.get_image_query(iq1.id)
@@ -48,7 +48,7 @@ def test_counting_labels(gl_experimental: ExperimentalApi):
4848
def test_multiclass_labels(gl_experimental: ExperimentalApi):
4949
name = f"Test binary labels{datetime.utcnow()}"
5050
det = gl_experimental.create_multiclass_detector(name, "test_query", class_names=["apple", "banana", "cherry"])
51-
iq1 = gl_experimental.submit_image_query(det, "test/assets/cat.jpeg")
51+
iq1 = gl_experimental.submit_image_query(det, "test/assets/cat.jpeg", wait=0)
5252
gl_experimental.add_label(iq1, "apple")
5353
iq1 = gl_experimental.get_image_query(iq1.id)
5454
assert iq1.result.label == "apple"
@@ -69,7 +69,7 @@ def test_multiclass_labels(gl_experimental: ExperimentalApi):
6969
def test_bounding_box_labels(gl_experimental: ExperimentalApi):
7070
name = f"Test bounding box labels{datetime.utcnow()}"
7171
det = gl_experimental.create_bounding_box_detector(name, "test_query", "test_class")
72-
iq1 = gl_experimental.submit_image_query(det, "test/assets/cat.jpeg")
72+
iq1 = gl_experimental.submit_image_query(det, "test/assets/cat.jpeg", wait=0)
7373
gl_experimental.add_label(iq1, "NO_OBJECTS")
7474
iq1 = gl_experimental.get_image_query(iq1.id)
7575
assert iq1.result.label == "NO_OBJECTS"
@@ -87,7 +87,7 @@ def test_bounding_box_labels(gl_experimental: ExperimentalApi):
8787
def test_text_recognition_labels(gl_experimental: ExperimentalApi):
8888
name = f"Test text recognition labels{datetime.utcnow()}"
8989
det = gl_experimental.create_text_recognition_detector(name, "test_query")
90-
iq1 = gl_experimental.submit_image_query(det, "test/assets/cat.jpeg")
90+
iq1 = gl_experimental.submit_image_query(det, "test/assets/cat.jpeg", wait=0)
9191
gl_experimental.add_label(iq1, "apple text")
9292
iq1 = gl_experimental.get_image_query(iq1.id)
9393
assert iq1.result.text == "apple text"

0 commit comments

Comments
 (0)