Ejemplo n.º 1
0
    def test_rna_fasta_format_id_starts_with_space(self):
        filepath = self.get_data_path(
            'dna-sequences-id-starts-with-space.fasta')
        format = RNAFASTAFormat(filepath, mode='r')

        with self.assertRaisesRegex(ValidationError, '1 starts with a space'):
            format.validate()
Ejemplo n.º 2
0
    def test_rna_fasta_format_consecutive_IDs(self):
        filepath = self.get_data_path('dna-sequences-consecutive-ids.fasta')
        format = RNAFASTAFormat(filepath, mode='r')

        with self.assertRaisesRegex(
                ValidationError, 'consecutive descriptions.*1'):
            format.validate()
Ejemplo n.º 3
0
    def test_rna_fasta_format_invalid_characters(self):
        filepath = self.get_data_path('not-rna-sequences.fasta')
        format = RNAFASTAFormat(filepath, mode='r')

        with self.assertRaisesRegex(ValidationError, "Invalid character '1' "
                                                     ".*0 on line 2"):
            format.validate()
Ejemplo n.º 4
0
    def test_rna_fasta_format_empty_file(self):
        filepath = os.path.join(self.temp_dir.name, 'empty')
        with open(filepath, 'w') as fh:
            fh.write('\n')
        format = RNAFASTAFormat(filepath, mode='r')

        format.validate()
Ejemplo n.º 5
0
    def test_rna_fasta_format_no_id(self):
        filepath = self.get_data_path('dna-sequences-no-id.fasta')
        format = RNAFASTAFormat(filepath, mode='r')

        with self.assertRaisesRegex(ValidationError, '1.*missing an ID'):
            format.validate()
Ejemplo n.º 6
0
    def test_rna_fasta_format_duplicate_ids(self):
        filepath = self.get_data_path('rna-sequences-with-duplicate-ids.fasta')
        format = RNAFASTAFormat(filepath, mode='r')

        with self.assertRaisesRegex(ValidationError, '6.*duplicate.*1'):
            format.validate()
Ejemplo n.º 7
0
    def test_rna_fasta_format_bom_fails(self):
        filepath = self.get_data_path('dna-with-bom-fails.fasta')
        format = RNAFASTAFormat(filepath, mode='r')

        with self.assertRaisesRegex(ValidationError, 'First line'):
            format.validate()
Ejemplo n.º 8
0
    def test_rna_fasta_format_corrupt_characters(self):
        filepath = self.get_data_path('dna-sequences-corrupt-characters.fasta')
        format = RNAFASTAFormat(filepath, mode='r')

        with self.assertRaisesRegex(ValidationError, 'utf-8.*2'):
            format.validate()
Ejemplo n.º 9
0
    def test_rna_fasta_format_missing_initial_ID(self):
        filepath = self.get_data_path('dna-sequences-first-line-not-id.fasta')
        format = RNAFASTAFormat(filepath, mode='r')

        with self.assertRaisesRegex(ValidationError, 'First line'):
            format.validate()
Ejemplo n.º 10
0
    def test_rna_fasta_format_validate_negative(self):
        filepath = self.get_data_path('not-rna-sequences')
        format = RNAFASTAFormat(filepath, mode='r')

        with self.assertRaisesRegex(ValidationError, 'RNAFASTA'):
            format.validate()
Ejemplo n.º 11
0
    def test_rna_fasta_format_bom_passes(self):
        filepath = self.get_data_path('rna-with-bom-passes.fasta')
        format = RNAFASTAFormat(filepath, mode='r')

        format.validate()
Ejemplo n.º 12
0
    def test_rna_fasta_format_validate_positive(self):
        filepath = self.get_data_path('rna-sequences.fasta')
        format = RNAFASTAFormat(filepath, mode='r')

        format.validate()