Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krrome committed Oct 8, 2018
1 parent 6eaeb33 commit 300b342
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/data/sample_intervals.bed
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
chr1 2 4 1
chr1 2 1000 1
chr1 2 5000 1
chr1 2 1002 1
chr1 602 604 1
24 changes: 14 additions & 10 deletions tests/datasets/test_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,17 @@ def test_seq_dataset(intervals_file, fasta_file):


# download example files
def test_examples_exist():
ex = SeqStringDataset.init_example()
out = ex.load_all()
assert len(out['inputs']) == len(ex)
assert len(ex) == 4

ex = SeqDataset.init_example()
out = ex.load_all()
assert len(out['inputs']) == len(ex)
assert len(ex) == 4
@pytest.mark.parametrize("cls", [SeqStringDataset, SeqDataset])
def test_examples_exist(cls):
ex = cls.init_example()
example_kwargs = cls.example_kwargs
bed_fh = open(example_kwargs['intervals_file'], "r")
bed_entries = len([el for el in bed_fh])
bed_fh.close()

dl_entries = 0
for out in ex:
dl_entries += 1
assert dl_entries == len(ex)
assert len(ex) == bed_entries

0 comments on commit 300b342

Please sign in to comment.