def test_scan_timeout_scan_in_progress(self, mock_post, mock_get):
     '''
     Test for a scan where analysis time exceeds timeout period
     '''
     print('Running test_scan_timeout_scan_in_progress')
     resultlist, metadata = Metadefender.scan(RANDOM_INPUT_FILES,
                                              conf=self.create_conf_short_timeout())
     self.assertEquals(len(resultlist), len(RANDOM_INPUT_FILES))
     for scan_res in resultlist:
         self.assertEquals(scan_res[1]['overall_status'], Metadefender.STATUS_TIMEOUT)
 def test_scan_complete_success(self, mock_post, mock_get):
     '''
     Test for a perfect scan. No submission errors, no retrieval errors
     '''
     print('Running test_scan_complete_success')
     resultlist, metadata = Metadefender.scan(RANDOM_INPUT_FILES,
                                              conf=self.create_conf_short_timeout())
     self.assertEquals(len(resultlist), len(RANDOM_INPUT_FILES))
     for scan_res in resultlist:
         self.assertEquals(scan_res[1]['overall_status'], Metadefender.STATUS_SUCCESS)
Пример #3
0
 def test_scan_timeout_scan_in_progress(self, mock_post, mock_get):
     '''
     Test for a scan where analysis time exceeds timeout period
     '''
     print('Running test_scan_timeout_scan_in_progress')
     resultlist, metadata = Metadefender.scan(
         RANDOM_INPUT_FILES, conf=self.create_conf_short_timeout())
     self.assertEquals(len(resultlist), len(RANDOM_INPUT_FILES))
     for scan_res in resultlist:
         self.assertEquals(scan_res[1]['overall_status'],
                           Metadefender.STATUS_TIMEOUT)
Пример #4
0
 def test_scan_complete_success(self, mock_post, mock_get):
     '''
     Test for a perfect scan. No submission errors, no retrieval errors
     '''
     print('Running test_scan_complete_success')
     resultlist, metadata = Metadefender.scan(
         RANDOM_INPUT_FILES, conf=self.create_conf_short_timeout())
     self.assertEquals(len(resultlist), len(RANDOM_INPUT_FILES))
     for scan_res in resultlist:
         self.assertEquals(scan_res[1]['overall_status'],
                           Metadefender.STATUS_SUCCESS)