Mercurial > repos > vimalkumarvelayudhan > riboplot
comparison tests/test_ribocount.py @ 12:61c47a1d6a7a
Add a test to check if a valid FASTA file is used (ribocount)
| author | Vimalkumar Velayudhan <vimal@biotechcoder.com> |
|---|---|
| date | Wed, 19 Aug 2015 11:11:37 +0100 |
| parents | |
| children | 628f82e72d72 |
comparison
equal
deleted
inserted
replaced
| 11:7571f5c89090 | 12:61c47a1d6a7a |
|---|---|
| 1 import os | |
| 2 import logging | |
| 3 import unittest | |
| 4 | |
| 5 from riboplot import ribocore, riboplot, ribocount | |
| 6 | |
| 7 # use testing configuration | |
| 8 CONFIG = ribocount.CONFIG = riboplot.config.TestingConfig() | |
| 9 logging.disable(logging.CRITICAL) | |
| 10 | |
| 11 RIBO_FILE = os.path.join(CONFIG.DATA_DIR, '5hRPFsorted.bam') | |
| 12 RNA_FILE = os.path.join(CONFIG.DATA_DIR, '5hmRNAsorted.bam') | |
| 13 TRANSCRIPT_NAME = 'gi|148357119|ref|NM_001098396.1|' | |
| 14 TRANSCRIPTOME_FASTA = os.path.join(CONFIG.DATA_DIR, 'zebrafish.fna') | |
| 15 TRANSCRIPTOME_FASTA_MINUS1 = os.path.join(CONFIG.DATA_DIR, 'zebrafish_minus1.fna') | |
| 16 UNRELATED_FASTA = os.path.join(CONFIG.DATA_DIR, 'unrelated.fna') | |
| 17 | |
| 18 | |
| 19 class RiboCountTestCase(unittest.TestCase): | |
| 20 | |
| 21 def test_unrelated_fasta_file(self): | |
| 22 """If an unrelated fasta file is used, raise an error""" | |
| 23 parser = ribocount.create_parser() | |
| 24 args = parser.parse_args(['-b', RIBO_FILE, '-f', UNRELATED_FASTA]) | |
| 25 self.assertRaises(ribocore.ArgumentError, ribocount.main, args) |
