File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -210,14 +210,6 @@ def setUp(self):
210
210
status = 200 ,
211
211
)
212
212
213
- # Upload image
214
- responses .add (
215
- responses .POST ,
216
- f"{ API_URL } /dataset/{ PROJECT_NAME } /upload?api_key={ ROBOFLOW_API_KEY } " f"&batch={ DEFAULT_BATCH_NAME } " ,
217
- json = {"duplicate" : True , "id" : "hbALkCFdNr9rssgOUXug" },
218
- status = 200 ,
219
- )
220
-
221
213
self .connect_to_roboflow ()
222
214
223
215
def tearDown (self ):
Original file line number Diff line number Diff line change 1
- from tests import RoboflowTest
1
+ import responses
2
+
3
+ from roboflow import API_URL
4
+ from roboflow .config import DEFAULT_BATCH_NAME
5
+ from tests import RoboflowTest , PROJECT_NAME , ROBOFLOW_API_KEY
2
6
3
7
4
8
class TestProject (RoboflowTest ):
5
9
def test_check_valid_image_with_accepted_formats (self ):
10
+ # Mock dataset upload
11
+ responses .add (
12
+ responses .POST ,
13
+ f"{ API_URL } /dataset/{ PROJECT_NAME } /upload?api_key={ ROBOFLOW_API_KEY } " f"&batch={ DEFAULT_BATCH_NAME } " ,
14
+ json = {"duplicate" : True , "id" : "hbALkCFdNr9rssgOUXug" },
15
+ status = 200 ,
16
+ )
17
+
6
18
images_to_test = [
7
19
"rabbit.JPG" ,
8
20
"rabbit2.jpg" ,
@@ -14,6 +26,14 @@ def test_check_valid_image_with_accepted_formats(self):
14
26
self .assertTrue (self .project .check_valid_image (f"tests/images/{ image } " ))
15
27
16
28
def test_check_valid_image_with_unaccepted_formats (self ):
29
+ # Mock dataset upload
30
+ responses .add (
31
+ responses .POST ,
32
+ f"{ API_URL } /dataset/{ PROJECT_NAME } /upload?api_key={ ROBOFLOW_API_KEY } " f"&batch={ DEFAULT_BATCH_NAME } " ,
33
+ json = {"duplicate" : True , "id" : "hbALkCFdNr9rssgOUXug" },
34
+ status = 200 ,
35
+ )
36
+
17
37
images_to_test = [
18
38
"sky-rabbit.gif" ,
19
39
"sky-rabbit.heic" ,
You can’t perform that action at this time.
0 commit comments