Skip to content

Commit 0c83b21

Browse files
Will-Tylerjeromekelleher
authored andcommitted
Add triploid unit test
1 parent 744cf78 commit 0c83b21

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

tests/data/vcf/triploid.vcf.gz

325 Bytes
Binary file not shown.

tests/data/vcf/triploid.vcf.gz.csi

112 Bytes
Binary file not shown.

tests/test_vcf_examples.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import collections
22
import pathlib
3+
import re
34

45
import cyvcf2
56
import numpy as np
@@ -451,6 +452,15 @@ def test_call_LAA(self, ds):
451452
nt.assert_array_equal(ds.call_LAA.values, call_LAA)
452453

453454

455+
class TestTriploidExample:
456+
data_path = "tests/data/vcf/triploid.vcf.gz"
457+
458+
def test_value_error(self, tmp_path_factory):
459+
icf_path = tmp_path_factory.mktemp("data") / "triploid.icf"
460+
with pytest.raises(ValueError, match=re.escape("Cannot handle ploidy = 3")):
461+
vcf2zarr.explode(icf_path, [self.data_path], worker_processes=0)
462+
463+
454464
class Test1000G2020Example:
455465
data_path = "tests/data/vcf/1kg_2020_chrM.vcf.gz"
456466

0 commit comments

Comments
 (0)