Skip to content

Commit

Permalink
Test the package
Browse files Browse the repository at this point in the history
  • Loading branch information
veghp committed Apr 15, 2024
1 parent 8ed0ad3 commit ff9c72c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/data/test.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
>seq1
ACGGCCAATTCCTCGTAGTTGTAGT
>seq2
CTCAATCAGATCGATTGCAATGCACCATCGGG
>seq3
TGATGATGAAAGACAGCCGATGACATGGCGTACTACAGACGC
12 changes: 12 additions & 0 deletions tests/test_SeqCollection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os

import seqreport

data_dir = os.path.join("tests", "data")
seq_fasta = os.path.join(data_dir, "test.fa")


def test_SeqCollection(tmpdir):
seq_coll = seqreport.SeqCollection(fasta=seq_fasta)
assert seq_coll.n_seq == 3
assert seq_coll.n_bp == 99
16 changes: 16 additions & 0 deletions tests/test_reports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os

import seqreport

data_dir = os.path.join("tests", "data")
seq_fasta = os.path.join(data_dir, "test.fa")


def test_write_pdf_report(tmpdir):
seq_coll = seqreport.SeqCollection(fasta=seq_fasta)
pdf_path = os.path.join(str(tmpdir), "test_report.pdf")
seqreport.write_pdf_report(target=pdf_path, seqcollection=seq_coll)

with open(pdf_path, "rb") as f:
filesize = len(f.read())
assert filesize > 40000

0 comments on commit ff9c72c

Please sign in to comment.