Ejemplo n.º 1
0
 def test_exists_noexist_return_jobid(self):
     """tests that non-existant job with bad samples returns false"""
     exists, jid = Job.exists(
         "16S", "Beta Diversity",
         {"--otu_table_fp": 1, "--mapping_fp": 27}, Analysis(1),
         return_existing=True)
     self.assertFalse(exists)
     self.assertEqual(jid, None)
Ejemplo n.º 2
0
 def test_exists(self):
     # need to insert matching sample data into analysis 2
     self.conn_handler.execute(
         "DELETE FROM qiita.analysis_sample WHERE analysis_id = 2")
     self.conn_handler.execute(
         "INSERT INTO qiita.analysis_sample (analysis_id, "
         "processed_data_id, sample_id) VALUES (2,1,'SKB8.640193'), "
         "(2,1,'SKD8.640184'), (2,1,'SKB7.640196'), (2,1,'SKM9.640192'),"
         "(2,1,'SKM4.640180')")
     """tests that existing job returns true"""
     self.assertTrue(Job.exists("18S", "Beta Diversity",
                                {"--otu_table_fp": 1,
                                 "--mapping_fp": 1}, Analysis(1)))
Ejemplo n.º 3
0
 def test_exists(self):
     """tests that existing job returns true"""
     # need to insert matching sample data into analysis 2
     self.conn_handler.execute(
         "DELETE FROM qiita.analysis_sample WHERE analysis_id = 2")
     self.conn_handler.execute(
         "INSERT INTO qiita.analysis_sample "
         "(analysis_id, processed_data_id, sample_id) VALUES "
         "(2, 1,'1.SKB8.640193'), (2, 1,'1.SKD8.640184'), "
         "(2, 1,'1.SKB7.640196'), (2, 1,'1.SKM9.640192'), "
         "(2, 1,'1.SKM4.640180')")
     self.assertTrue(Job.exists("18S", "Beta Diversity",
                                {"--otu_table_fp": 1,
                                 "--mapping_fp": 1}, Analysis(1)))
Ejemplo n.º 4
0
 def test_exists_noexist_options(self):
     # need to insert matching sample data into analysis 2
     # makes sure failure is because options and not samples
     self.conn_handler.execute(
         "DELETE FROM qiita.analysis_sample WHERE analysis_id = 2")
     self.conn_handler.execute(
         "INSERT INTO qiita.analysis_sample (analysis_id, "
         "processed_data_id, sample_id) VALUES (2,1,'SKB8.640193'), "
         "(2,1,'SKD8.640184'), (2,1,'SKB7.640196'), (2,1,'SKM9.640192'),"
         "(2,1,'SKM4.640180')")
     """tests that non-existant job with bad options returns false"""
     self.assertFalse(Job.exists("18S", "Beta Diversity",
                                 {"--otu_table_fp": 1,
                                  "--mapping_fp": 27}, Analysis(1)))
Ejemplo n.º 5
0
 def test_exists_noexist_options(self):
     """tests that non-existant job with bad options returns false"""
     # need to insert matching sample data into analysis 2
     # makes sure failure is because options and not samples
     self.conn_handler.execute(
         "DELETE FROM qiita.analysis_sample WHERE analysis_id = 2")
     self.conn_handler.execute(
         "INSERT INTO qiita.analysis_sample "
         "(analysis_id, processed_data_id, sample_id) VALUES "
         "(2, 1,'1.SKB8.640193'), (2, 1,'1.SKD8.640184'), "
         "(2, 1,'1.SKB7.640196'), (2, 1,'1.SKM9.640192'), "
         "(2, 1,'1.SKM4.640180')")
     self.assertFalse(Job.exists("18S", "Beta Diversity",
                                 {"--otu_table_fp": 1,
                                  "--mapping_fp": 27}, Analysis(1)))
Ejemplo n.º 6
0
 def test_exists_return_jobid(self):
     """tests that existing job returns true"""
     # need to insert matching sample data into analysis 2
     self.conn_handler.execute(
         "DELETE FROM qiita.analysis_sample WHERE analysis_id = 2")
     self.conn_handler.execute(
         "INSERT INTO qiita.analysis_sample "
         "(analysis_id, processed_data_id, sample_id) VALUES "
         "(2, 1,'1.SKB8.640193'), (2, 1,'1.SKD8.640184'), "
         "(2, 1,'1.SKB7.640196'), (2, 1,'1.SKM9.640192'), "
         "(2, 1,'1.SKM4.640180')")
     exists, jid = Job.exists("18S", "Beta Diversity",
                              {"--otu_table_fp": 1, "--mapping_fp": 1},
                              Analysis(1), return_existing=True)
     self.assertTrue(exists)
     self.assertEqual(jid, Job(2))
Ejemplo n.º 7
0
 def test_exists_return_jobid(self):
     # need to insert matching sample data into analysis 2
     self.conn_handler.execute(
         "DELETE FROM qiita.analysis_sample WHERE analysis_id = 2")
     self.conn_handler.execute(
         "INSERT INTO qiita.analysis_sample (analysis_id, "
         "processed_data_id, sample_id) VALUES (2,1,'SKB8.640193'), "
         "(2,1,'SKD8.640184'), (2,1,'SKB7.640196'), (2,1,'SKM9.640192'),"
         "(2,1,'SKM4.640180')")
     """tests that existing job returns true"""
     exists, jid = Job.exists("18S",
                              "Beta Diversity", {
                                  "--otu_table_fp": 1,
                                  "--mapping_fp": 1
                              },
                              Analysis(1),
                              return_existing=True)
     self.assertTrue(exists)
     self.assertEqual(jid, Job(2))