<commit_before>module TestTools

if VERSION >= v"0.5-"
    using Base.Test
else
    using BaseTestNext
    const Test = BaseTestNext
end

using Bio.Seq,
      Bio.Blast,
      TestFunctions

get_bio_fmt_specimens()
path = Pkg.dir("Bio", "test", "BioFmtSpecimens")

@testset "Blast+ blastn" begin
    na1 = dna"CGGACCAGACGGACACAGGGAGAAGCTAGTTTCTTTCATGTGATTGANATNATGACTCTACTCCTAAAAGGGAAAAANCAATATCCTTGTTTACAGAAGAGAAACAAACAAGCCCCACTCAGCTCAGTCACAGGAGAGAN"
    na2 = dna"CGGAGCCAGCGAGCATATGCTGCATGAGGACCTTTCTATCTTACATTATGGCTGGGAATCTTACTCTTTCATCTGATACCTTGTTCAGATTTCAAAATAGTTGTAGCCTTATCCTGGTTTTACAGATGTGAAACTTTCAA"
    fna = joinpath(path, "FASTA", "f002.fasta")
    nucldb = joinpath(path, "BLASTDB", "f002")
    nuclresults = joinpath(path, "BLASTDB", "f002.xml")

    @test blastn(na1, na2)
    @test blastn(na1, [na1, na2])
    @test blastn([na1, na2], [na1, na2])
    @test blastn(na1, nucldb, db=true)
    @test blastn(na1, fna)
    @test blastn(fna, nucldb, db=true)

end

@testset "Blast+ blastp" begin
    aa1 = aa"MWATLPLLCAGAWLLGVPVCGAAELSVNSLEKFHFKSWMSKHRKTYSTEEYHHRLQTFASNWRKINAHNNGNHTFKMALNQFSDMSFAEIKHKYLWSEPQNCSATKSNYLRGTGPYPPSVDWRKKGNFVSPVKNQGACGS"
    aa2 = aa"<KEY>"
    faa = joinpath(path, "FASTA", "cysprot.fasta")
    protdb = joinpath(path, "BLASTDB", "cysprot")
    protresults = joinpath(path, "BLASTDB", "cysprot.xml")

    @test blastp(aa1, aa2)
    @test blastp(aa1, [aa1, aa2])
    @test blastp([aa1, aa2], [aa1, aa2])
    @test blastp(aa1, protdb, db=true)
    @test blastp(aa1, faa)
    @test blastp(faa, protdb, db=true)
end

end # TestTools<commit_msg>made tests evaluate to Boolean<commit_after>module TestTools

if VERSION >= v"0.5-"
    using Base.Test
else
    using BaseTestNext
    const Test = BaseTestNext
end

using Bio.Seq,
      Bio.Blast,
      TestFunctions

get_bio_fmt_specimens()
path = Pkg.dir("Bio", "test", "BioFmtSpecimens")

@testset "Blast+ blastn" begin
    na1 = dna"CGGACCAGACGGACACAGGGAGAAGCTAGTTTCTTTCATGTGATTGANATNATGACTCTACTCCTAAAAGGGAAAAANCAATATCCTTGTTTACAGAAGAGAAACAAACAAGCCCCACTCAGCTCAGTCACAGGAGAGAN"
    na2 = dna"CGGAGCCAGCGAGCATATGCTGCATGAGGACCTTTCTATCTTACATTATGGCTGGGAATCTTACTCTTTCATCTGATACCTTGTTCAGATTTCAAAATAGTTGTAGCCTTATCCTGGTTTTACAGATGTGAAACTTTCAA"
    fna = joinpath(path, "FASTA", "f002.fasta")
    nucldb = joinpath(path, "BLASTDB", "f002")
    nuclresults = joinpath(path, "BLASTDB", "f002.xml")

    @test typeof(blastn(na1, na2)) == Array{BlastResult, 1}
    @test typeof(blastn(na1, [na1, na2])) == Array{BlastResult, 1}
    @test typeof(blastn([na1, na2], [na1, na2])) == Array{BlastResult, 1}
    @test typeof(blastn(na1, nucldb, db=true)) == Array{BlastResult, 1}
    @test typeof(blastn(na1, fna)) == Array{BlastResult, 1}
    @test typeof(blastn(fna, nucldb, db=true)) == Array{BlastResult, 1}

end

@testset "Blast+ blastp" begin
    aa1 = aa"MW<KEY>"
    aa2 = aa"M<KEY>"
    faa = joinpath(path, "FASTA", "cysprot.fasta")
    protdb = joinpath(path, "BLASTDB", "cysprot")
    protresults = joinpath(path, "BLASTDB", "cysprot.xml")

    @test typeof(blastp(aa1, aa2)) == Array{BlastResult, 1}
    @test typeof(blastp(aa1, [aa1, aa2])) == Array{BlastResult, 1}
    @test typeof(blastp([aa1, aa2], [aa1, aa2])) == Array{BlastResult, 1}
    @test typeof(blastp(aa1, protdb, db=true)) == Array{BlastResult, 1}
    @test typeof(blastp(aa1, faa)) == Array{BlastResult, 1}
    @test typeof(blastp(faa, protdb, db=true)) == Array{BlastResult, 1}
end

end # TestTools
{'fraction_non_alphanumeric': 0.1320151206746147, 'fraction_numerical': 0.02500726955510323, 'mean_word_length': 5.198198198198198, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4974667', 'n_tokens_mistral': 1599, 'n_tokens_neox': 1477, 'n_words': 253}