示例#1
0
 def test_invalid_taxid(self):
     with scratch_file() as out:
         with open(out, 'w') as h:
             class _Args(object):
                 database_file = config.ncbi_master_db
                 taxids = 'horace,hilda'
                 taxnames = None
                 seq_info = None
                 verbosity = 0
                 out_file = h
             self.assertEqual(taxtable.action(_Args()), 1)
 def test_taxids(self):
     with scratch_file() as out:
         with open(out, 'w') as h:
             class _Args(object):
                 database_file = config.ncbi_master_db
                 taxids = config.data_path('taxids1.txt')
                 taxnames = None
                 seq_info = None
                 verbosity = 0
                 out_file = h
             self.assertEqual(taxtable.action(_Args()), 0)
         self.assertEqual(refpkg.md5file(out), '88ed5643d4754c60d5c472ff0b298f0f')
示例#3
0
 def test_seqinfo(self):
     with tempfile.TemporaryFile() as tf, \
          open(config.data_path('simple_seqinfo.csv')) as ifp:
         class _Args(object):
             database_file = config.ncbi_master_db
             taxids = None
             taxnames = None
             seq_info = ifp
             out_file = tf
             verbosity = 0
         self.assertEqual(taxtable.action(_Args()), 0)
         # No output check at present
         self.assertTrue(tf.tell() > 0)
示例#4
0
    def test_invalid_taxid(self):
        with scratch_file() as out:
            with open(out, 'w') as h:

                class _Args(object):
                    database_file = config.ncbi_master_db
                    taxids = 'horace,hilda'
                    taxnames = None
                    seq_info = None
                    verbosity = 0
                    out_file = h
                    full = False

                self.assertNotEqual(taxtable.action(_Args()), 0)
示例#5
0
    def test_seqinfo(self):
        with tempfile.TemporaryFile() as tf, \
                open(config.data_path('simple_seqinfo.csv')) as ifp:

            class _Args(object):
                database_file = config.ncbi_master_db
                taxids = None
                taxnames = None
                seq_info = ifp
                out_file = tf
                verbosity = 0
                full = False

            self.assertEqual(taxtable.action(_Args()), 0)
            # No output check at present
            self.assertTrue(tf.tell() > 0)
示例#6
0
    def test_seqinfo(self):
        with tempfile.TemporaryFile() as tf, \
                open(config.data_path('simple_seqinfo.csv')) as ifp:

            class _Args(object):
                url = 'sqlite:///' + config.ncbi_master_db
                schema = None
                valid = False
                ranked = False
                tax_ids = None
                taxnames = None
                seq_info = ifp
                out = tf
                verbosity = 0
                clade_ids = None
                taxtable = None

            self.assertIsNone(taxtable.action(_Args()))
            # No output check at present
            self.assertTrue(tf.tell() > 0)