FrancisGOS commited on
Commit
b518521
·
1 Parent(s): 8860333
Files changed (2) hide show
  1. tests/test_friend_request.py +11 -4
  2. tests/test_video.py +18 -18
tests/test_friend_request.py CHANGED
@@ -132,10 +132,17 @@ class TestFriendRequest:
132
  "Content-Type": "application/json",
133
  "Authorization": "Bearer " + inviter["token"],
134
  }
135
- response = client.request(
136
- "POST", "friend_request", headers=headers, data=payload
137
- )
138
- assert response.status_code == 200
 
 
 
 
 
 
 
139
  result = mmcv.imfrombytes(response.read())
140
  # Check returned QR image
141
  assert result.shape[2] == 3
 
132
  "Content-Type": "application/json",
133
  "Authorization": "Bearer " + inviter["token"],
134
  }
135
+ flag = False
136
+ for i in range(5):
137
+ response = client.request(
138
+ "POST", "friend_request", headers=headers, data=payload
139
+ )
140
+ if response.status_code == 200:
141
+ flag = True
142
+ break
143
+ else:
144
+ time.sleep(2)
145
+ assert flag == True
146
  result = mmcv.imfrombytes(response.read())
147
  # Check returned QR image
148
  assert result.shape[2] == 3
tests/test_video.py CHANGED
@@ -108,24 +108,24 @@ class TestVideoAPI:
108
  assert index == 1
109
  doc.delete()
110
 
111
- def test_update_artifact(self):
112
- # Check and preprocess test data before testing
113
- test_artifact = db.collection("artifacts").document("test")
114
- if not test_artifact.get().exists:
115
- db.collection("artifacts").document("test").set(
116
- {"name": "test", "path": "", "status": "testing", "thumbnailURL": ""}
117
- )
118
- test_artifact = db.collection("artifacts").document("test")
119
- else:
120
- test_artifact.update({"status": "testing", "path": "", "thumbnailURL": ""})
121
- # Testing update on each field
122
- updateArtifact(test_artifact.id, {"status": "test_done"})
123
- assert (
124
- db.collection("artifacts").document("test").get().to_dict()["status"]
125
- == "test_done"
126
- )
127
- # Delete data for next time test
128
- test_artifact.delete()
129
 
130
  def test_inference_frame(self):
131
  if not os.path.exists("test_vid"):
 
108
  assert index == 1
109
  doc.delete()
110
 
111
+ # def test_update_artifact(self):
112
+ # # Check and preprocess test data before testing
113
+ # test_artifact = db.collection("artifacts").document("test")
114
+ # if not test_artifact.get().exists:
115
+ # db.collection("artifacts").document("test").set(
116
+ # {"name": "test", "path": "", "status": "testing", "thumbnailURL": ""}
117
+ # )
118
+ # test_artifact = db.collection("artifacts").document("test")
119
+ # else:
120
+ # test_artifact.update({"status": "testing", "path": "", "thumbnailURL": ""})
121
+ # # Testing update on each field
122
+ # updateArtifact(test_artifact.id, {"status": "test_done"})
123
+ # assert (
124
+ # db.collection("artifacts").document("test").get().to_dict()["status"]
125
+ # == "test_done"
126
+ # )
127
+ # # Delete data for next time test
128
+ # test_artifact.delete()
129
 
130
  def test_inference_frame(self):
131
  if not os.path.exists("test_vid"):