Exemple #1
0
 def test_scan_add(self):
     scan = scan_new()
     date = scan.date
     scanid = scan.id
     scan = scan_add(scan.id, FILEPATHS)
     self.assertEqual(scan.pstatus, "ready")
     self._check_scan(scan, scanid, ["ready"], FILENAMES, [0], [0], date,
                      False, False, False)
     scan = scan_cancel(scan.id)
     self._check_scan(scan, scanid, ["cancelled"], FILENAMES, [0], [0],
                      date, False, False, False)
Exemple #2
0
 def test_scan_files(self):
     force = True
     probes = probe_list()
     nb_jobs = len(FILENAMES) * len(probes)
     scan = scan_files(FILEPATHS, force, probe=probes)
     self._check_scan(scan, scan.id, ["ready", "uploaded", "launched"],
                      FILENAMES, range(nb_jobs), range(nb_jobs + 1),
                      scan.date, True, True, True)
     scan = scan_cancel(scan.id)
     self._check_scan(scan, scan.id, ["cancelled"],
                      FILENAMES, range(nb_jobs), range(nb_jobs + 1),
                      scan.date, True, True, True)
Exemple #3
0
 def test_scan_force(self):
     scan = scan_new()
     date = scan.date
     scanid = scan.id
     scan = scan_add(scan.id, FILEPATHS)
     force = False
     probes = probe_list()
     nb_jobs = len(FILENAMES) * len(probes)
     scan = scan_launch(scan.id, force, probe=probes)
     self._check_scan(scan, scanid, ["ready", "uploaded", "launched"],
                      FILENAMES, range(nb_jobs), range(nb_jobs + 1),
                      date, force, True, True)
     scan = scan_cancel(scan.id)
     self._check_scan(scan, scanid, ["cancelled"],
                      FILENAMES, range(nb_jobs), range(nb_jobs + 1),
                      date, force, True, True)
Exemple #4
0
 def test_mimetype_filtering(self):
     scan = scan_new()
     date = scan.date
     scanid = scan.id
     scan = scan_add(scan.id, FILEPATHS)
     force = True
     mimetype_filtering = False
     probes = probe_list()
     nb_jobs = len(FILENAMES) * len(probes)
     scan = scan_launch(scan.id, force, probes,
                        mimetype_filtering=mimetype_filtering)
     self._check_scan(scan, scanid, ["ready", "uploaded",
                                     "launched", "finished"],
                      FILENAMES, range(nb_jobs + 1), range(nb_jobs + 1),
                      date, force, mimetype_filtering, True)
     scan = scan_cancel(scan.id)
     self._check_scan(scan, scanid, ["cancelled"],
                      FILENAMES, range(nb_jobs + 1), range(nb_jobs + 1),
                      date, force, mimetype_filtering, True)