コード例 #1
0
 def test_annotate_errorFile(self):
     from Demo import annotate
     self.files = {"video": self.video, "filename": "demo.avi"}
     self.request.files = self.files
     response = {
         "error_id": "Bad Request",
         "error_message": "video file missing"
     }
     out = annotate(self.request)
     self.assertEqual(out, response)
コード例 #2
0
 def test_annotate_errorThreat(self):
     from Demo import annotate
     self.form = {"behav": self.behav, "emo": self.emo}
     self.request.form = self.form
     response = {
         "error_id": "Bad Request",
         "error_message": "parameters missing : 'threat' "
     }
     out = annotate(self.request)
     self.assertEqual(out, response)
コード例 #3
0
 def test_Annotate_error_Expires_1000(self):
     from Demo import annotate
     self.form['expires_in'] = 1000
     self.request.form = self.form
     response = {
         "themobe_id": 123,
         "video": "demo.mp4",
         "video_status": "processing",
         "expires_in": self.DEFAULT_EXPIRES_IN,
         "interval": self.DEFAULT_POLLING_INTERVAL
     }
     out = annotate(self.request)
     self.assertEqual(out, response)
コード例 #4
0
 def test_Annotate_error_Persist_Expires(self):
     from Demo import annotate
     self.form = {
         "behav": self.behav,
         "emo": self.emo,
         "threat": self.threat
     }
     self.request.form = self.form
     response = {
         "themobe_id": 123,
         "video": "demo.mp4",
         "video_status": "processing",
         "expires_in": self.DEFAULT_EXPIRES_IN,
         "interval": self.DEFAULT_POLLING_INTERVAL
     }
     out = annotate(self.request)
     self.assertEqual(out, response)