Example #1
0
    def test_flowgramAli_bin(self):
        """Check if we have a working FlowgramAligner"""
        ali_exe = get_flowgram_ali_exe()

        self.assertTrue(which(ali_exe) is not None, "The alignment program %s "
                        "is not accessible via the PATH environment variable."
                        % ali_exe)

        # test if its callable and actually works
        command = "%s -h" % ali_exe
        proc = Popen(command, shell=True, universal_newlines=True,
                     stdout=PIPE, stderr=STDOUT)

        if (proc.wait() != 0):
            self.fail("Calling %s failed. Check permissions and that it is in fact an executable."
                      % ali_exe)

        result = proc.stdout.read()
        # check that the help string looks correct
        self.assertTrue(result.startswith("Usage"))
Example #2
0
    def test_denoise_worker(self):
        """denoiser_worker.py is where it belongs and is callable."""
        DENOISE_WORKER = "denoiser_worker.py"

        self.assertTrue(which(DENOISE_WORKER) is not None,
                        "%s is not accessible via the PATH environment "
                        "variable." % DENOISE_WORKER)

        # test if its callable and actually works
        command = "%s -h" % DENOISE_WORKER
        proc = Popen(command, shell=True, universal_newlines=True,
                     stdout=PIPE, stderr=STDOUT)

        if (proc.wait() != 0):
            self.fail("Calling %s failed. Check permissions and that it is in fact an executable."
                      % DENOISE_WORKER)

        result = proc.stdout.read()
        # check that the help string looks correct
        self.assertTrue(result.startswith("Usage"))
Example #3
0
def check_flowgram_ali_exe():
    """Check if we have a working FlowgramAligner"""
    ali_exe = get_flowgram_ali_exe()

    if which(ali_exe) is None:
        raise ApplicationNotFoundError("The alignment program %s is not "
                                       "accessible via the PATH environment "
                                       "variable." % ali_exe)

    # test if its callable and actually works
    command = "%s -h" % ali_exe
    proc = Popen(command, shell=True, universal_newlines=True,
                 stdout=PIPE, stderr=STDOUT)

    if (proc.wait() != 0):
        raise ApplicationError("Calling %s failed. Check permissions and that it is in fact an executable."
                               % ali_exe)

    result = proc.stdout.read()
    # check that the help string looks correct
    if (not result.startswith("Usage")):
        raise ApplicationError("Calling %s failed. Check permissions and that it is in fact an executable."
                               % ali_exe)
    return True