예제 #1
0
 def test_RunGenovo_set_cutoff(self):
     """
     Note: There are different type of Errors
     Feel free to change/swap/move between ValueError and TypeError
     """
     infile_var = "test_infile.fasta"
     genovo = RunGenovo(infile=infile_var, pdir=self.data_dir, no_iter=3,
                        thresh=250, check_exist=False)
     self.assertRaises(ValueError, genovo.set_finalize_cutoff, 1.1)
     self.assertRaises(ValueError, genovo.set_finalize_cutoff, -1)
     self.assertRaises(ValueError, genovo.set_finalize_cutoff, -2.5)
     self.assertRaises(ValueError, genovo.set_finalize_cutoff, "string")
     try:
         genovo.set_finalize_cutoff("3")
     except ValueError as e:
         self.fail(e)
예제 #2
0
    def test_RunGenovo_simple_finalise(self):
        infile_var = "test_infile.fasta"
        genovo = RunGenovo(infile=infile_var, pdir=self.data_dir, no_iter=3,
                           thresh=250, check_exist=False)
        self.assertEqual(3, len(genovo.finalize._switch))
        expected = ["250", self.data_dir + "test_infile.genovo",
                    self.data_dir + infile_var + ".dump.best"]
        self.assertEqual(genovo.finalize.get_all_switches(), expected)

        genovo.set_finalize_cutoff(300)
        expected = ["300", self.data_dir + "test_infile.genovo",
                    self.data_dir + infile_var + ".dump.best"]
        self.assertEqual(genovo.finalize.get_all_switches(), expected)

        infile_var = "VICTORY!!!.fasta"
        genovo.set_infile_name(infile_var)
        expected = ["300", self.data_dir + "test_infile.genovo",
                    infile_var + ".dump.best"]
        self.assertEqual(genovo.finalize.get_all_switches(), expected)