Ejemplo n.º 1
0
 def setUp(self):
     super(PmProductionTest, self).setUp()
     if os.path.exists(delivery_dir):
         flist = walk(os.path.join(delivery_dir))
         for x in flist:
             os.unlink(x)
         shutil.rmtree(delivery_dir)
Ejemplo n.º 2
0
 def setUp(self):
     super(PmProductionTest, self).setUp()
     if os.path.exists(delivery_dir):
         flist = walk(os.path.join(delivery_dir))
         for x in flist:
             os.unlink(x)
         shutil.rmtree(delivery_dir)
Ejemplo n.º 3
0
 def setUp(self):
     super(ProjectTest, self).setUp()
     ## FIX ME: deliver data first - serves as test data
     self.app = self.make_app(argv = [])
     self.app.setup()
     self.fastq_dir = os.path.join(self.app.config.get("project", "root"), "j_doe_00_01", "data", flowcell)
     safe_makedir(self.fastq_dir)
     for f in self.COMPRESS_FILES:
         m = glob.glob("{}*".format(os.path.join(self.fastq_dir, f)))
         if not m:
             exit_code = shell.exec_cmd2(['touch', os.path.join(self.fastq_dir, f)])
     flist = walk(j_doe_00_04['data'])
     for f in flist:
         os.unlink(f)
Ejemplo n.º 4
0
 def setUp(self):
     super(ProjectTest, self).setUp()
     ## FIX ME: deliver data first - serves as test data
     self.app = self.make_app(argv=[])
     self.app.setup()
     self.fastq_dir = os.path.join(self.app.config.get("project", "root"),
                                   "j_doe_00_01", "data", flowcell)
     safe_makedir(self.fastq_dir)
     for f in self.COMPRESS_FILES:
         m = glob.glob("{}*".format(os.path.join(self.fastq_dir, f)))
         if not m:
             exit_code = shell.exec_cmd2(
                 ['touch', os.path.join(self.fastq_dir, f)])
     flist = walk(j_doe_00_04['data'])
     for f in flist:
         os.unlink(f)
Ejemplo n.º 5
0
 def rm(self):
     if not self._check_pargs(["project",  "analysis_id"]):
         return
     indir = os.path.join(self.app.controller._meta.project_root, self.app.controller._meta.path_id, self.pargs.analysis_id)
     assert os.path.exists(indir), "No such analysis {} for project {}".format(self.pargs.analysis_id, self.pargs.project)
     try:
         flist = walk(indir)
     except IOError as e:
         self.app.log.warn(str(e))
         raise e
     if len(flist) > 0 and not query_yes_no("Going to remove all contents ({} files) of analysis {} for project {}... Are you sure you want to continue?".format(len(flist), self.pargs.analysis_id, self.pargs.project), force=self.pargs.force):
         return
     for f in flist:
         self.app.cmd.safe_unlink(f)
     self.app.log.info("removing {}".format(indir))
     self.app.cmd.safe_rmdir(indir)