<commit_before>#!/usr/bin/env python3


from unittest import TestCase
from exfi.reduce_exons import reduce_exons
from tests.auxiliary_functions import \
    CustomAssertions, \
    _fasta_to_list

class TestReduceExons(TestCase, CustomAssertions):

    def test_empty_sequence(self):
        """reduce_exons.py: test empty fasta"""
        actual = list(reduce_exons(_fasta_to_list(
            "tests/files/reduce_exons/empty_sequence_input.fa"
        )))
        expected = _fasta_to_list(
            "tests/files/reduce_exons/empty_sequence_output.fa"
        )
        self.assertEqualListOfSeqrecords(actual, expected)

    def test_one_exon(self):
        """reduce_exons.py: test single exon"""
        actual = list(reduce_exons(_fasta_to_list(
            "tests/files/reduce_exons/one_exon_input.fa"
        )))
        expected = _fasta_to_list(
            "tests/files/reduce_exons/one_exon_output.fa"
        )
        self.assertEqualListOfSeqrecords(actual, expected)

    def test_same_exon(self):
        """reduce_exons.py: read the same exon twice"""
        actual = list(reduce_exons(_fasta_to_list(
            "tests/files/reduce_exons/same_exon_input.fa"
        )))
        expected = _fasta_to_list(
            "tests/files/reduce_exons/same_exon_output.fa"
        )
        self.assertEqualListOfSeqrecords(actual, expected)

    def test_different_exons(self):
        """reduce_exons.py: read the same exon twice"""
        actual = list(reduce_exons(_fasta_to_list(
            "tests/files/reduce_exons/different_exons_input.fa"
        )))
        expected = _fasta_to_list(
            "tests/files/reduce_exons/different_exons_output.fa"
        )
        self.assertEqualListOfSeqrecords(actual, expected)<commit_msg>Better test messages<commit_after>#!/usr/bin/env python3


from unittest import TestCase
from exfi.reduce_exons import reduce_exons
from tests.auxiliary_functions import \
    CustomAssertions, \
    _fasta_to_list

class TestReduceExons(TestCase, CustomAssertions):

    def test_empty_sequence(self):
        """reduce_exons: empty"""
        actual = list(reduce_exons(_fasta_to_list(
            "tests/files/reduce_exons/empty_sequence_input.fa"
        )))
        expected = _fasta_to_list(
            "tests/files/reduce_exons/empty_sequence_output.fa"
        )
        self.assertEqualListOfSeqrecords(actual, expected)

    def test_one_exon(self):
        """reduce_exons: single exon"""
        actual = list(reduce_exons(_fasta_to_list(
            "tests/files/reduce_exons/one_exon_input.fa"
        )))
        expected = _fasta_to_list(
            "tests/files/reduce_exons/one_exon_output.fa"
        )
        self.assertEqualListOfSeqrecords(actual, expected)

    def test_same_exon(self):
        """reduce_exons: same exon twice"""
        actual = list(reduce_exons(_fasta_to_list(
            "tests/files/reduce_exons/same_exon_input.fa"
        )))
        expected = _fasta_to_list(
            "tests/files/reduce_exons/same_exon_output.fa"
        )
        self.assertEqualListOfSeqrecords(actual, expected)

    def test_different_exons(self):
        """reduce_exons: different exons"""
        actual = list(reduce_exons(_fasta_to_list(
            "tests/files/reduce_exons/different_exons_input.fa"
        )))
        expected = _fasta_to_list(
            "tests/files/reduce_exons/different_exons_output.fa"
        )
        self.assertEqualListOfSeqrecords(actual, expected)
{'fraction_non_alphanumeric': 0.09381294964028777, 'fraction_numerical': 0.0005755395683453237, 'mean_word_length': 2.8072289156626504, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4121283', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1092, 'n_words': 149}