def test_is_fastq():
    good_name1 = "foo.fastq"
    good_name2 = "bar.fastq.gz"
    bad_name1 = "foo.fasta"
    bad_name2 = "bar.fastq.baz"
    assert_equal(provider_utils.is_fastq(good_name1), True)
    assert_equal(provider_utils.is_fastq(good_name2), True)
    assert_equal(provider_utils.is_fastq(bad_name1), False)
    assert_equal(provider_utils.is_fastq(bad_name2), False)
 def get_fastq_file_ending(self, filename):
     """Extract file ending from FASTQ filename"""
     if utils.is_fastq(filename) is False:
         raise ValueError("{0} is not a valid FASTQ file!".format(filename))
     pattern = "^.*(\.fastq(\.gz)?)$"
     match = search(pattern, filename)
     return match.group(1)
 def is_fastq(self, filename):
     """Check if file has FASTQ ending."""
     return utils.is_fastq(filename)