Example #1
0
 def test_vquest_main_custom_arg(self):
     """Try an extra argument given as though on the command line."""
     with tempfile.TemporaryDirectory() as tempdir:
         os.chdir(tempdir)
         main(["--IMGTrefdirSet", "1", str(self.path / "config.yml")])
         self.assertTrue(Path("vquest_airr.tsv").exists())
         self.assertTrue(Path("Parameters.txt").exists())
Example #2
0
 def test_vquest_main_no_collapse(self):
     """Test command-line interface with --no-collapse."""
     with tempfile.TemporaryDirectory() as tempdir:
         os.chdir(tempdir)
         main(["--no-collapse", str(self.path / "config.yml")])
         self.assertTrue(Path("001/vquest_airr.tsv").exists())
         self.assertTrue(Path("001/Parameters.txt").exists())
Example #3
0
 def test_vquest_main(self):
     """Test that the command-line interface gives the expected response."""
     with tempfile.TemporaryDirectory() as tempdir:
         os.chdir(tempdir)
         main([str(self.path / "config.yml")])
         self.assertTrue(Path("vquest_airr.tsv").exists())
         self.assertTrue(Path("Parameters.txt").exists())
Example #4
0
 def test_vquest_main(self):
     """Test that an html file with an error message is parsed correctly for cmd-line usage."""
     with self.assertRaises(VquestError) as err_cm:
         with tempfile.TemporaryDirectory() as tempdir:
             os.chdir(tempdir)
             main([str(self.path / "config.yml")])
     self.assertEqual(
         err_cm.exception.server_messages,
         ["The receptor type or locus is not available for this species"])
Example #5
0
    def test_vquest_main_no_args(self):
        """Test how the command-line interface handles no arguments.

        It should exit with a nonzero exit code and write the help text to
        stdout.
        """
        self.check_missing_defaults_main(lambda: main([]))
Example #6
0
    def test_vquest_main_alignment(self):
        """Try using the --align feature.

        In this case the regular output files should not be created and instead
        FASTA text should be written to stdout.
        """
        expected = """>IGKV2-ACR*02
gacattgtgatgacccagactccactctccctgcccgtcacccctggagagccagcctccatctcctgcaggtctagtcagagcctcttggatagt...gacgggtacacctgtttggactggtacctgcagaagccaggccagtctccacagctcctgatctatgaggtt.....................tccaaccgggtctctggagtccct...gacaggttcagtggcagtggg......tcagncactgatttcacactgaaaatcagccgggtggaagctgaggatgttggggtgtattactgtatgcaaagtatagagtttcctcc
"""
        out = StringIO()
        err = StringIO()
        with redirect_stdout(out), redirect_stderr(err):
            with tempfile.TemporaryDirectory() as tempdir:
                os.chdir(tempdir)
                main([str(self.path / "config.yml"), "--align"])
                self.assertFalse(Path("vquest_airr.tsv").exists())
                self.assertFalse(Path("Parameters.txt").exists())
        self.assertEqual(out.getvalue(), expected)
        self.assertEqual(err.getvalue(), "")
Example #7
0
 def test_vquest_main_alignment(self):
     self.check_missing_defaults_main(lambda: main(["--align"]))
Example #8
0
 def test_vquest_main_no_collapse(self):
     self.check_missing_defaults_main(lambda: main(["--no-collapse"]))
Example #9
0
 def test_vquest_main(self):
     self.check_missing_defaults(
         lambda: main([str(self.path / "config.yml")]))