Skip to content

Commit

Permalink
test that we can read breakpoints with extra underscores in their IDs…
Browse files Browse the repository at this point in the history
… (see #125)
  • Loading branch information
aryarm committed Nov 1, 2022
1 parent 8dca6c1 commit 440672a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,21 @@ def test_write(self):
self._compare_bkpt_data(observed.data.items(), expected.data)
expected.fname.unlink()

def test_load_underscore(self):
""" check if we can load samples with extra underscores in their IDs """
expected = self._get_expected_breakpoints()
expected.fname = Path("test.bp")
expected.data["Sam_ple_2"] = expected.data.pop("Sample_2")
expected.write()
observed = Breakpoints(expected.fname)
observed.read()

# first, check that the samples appear in the proper order
assert tuple(observed.data.keys()) == tuple(expected.data.keys())
# now, check that each sample is the same
self._compare_bkpt_data(observed.data.items(), expected.data)
expected.fname.unlink()

def test_encode(self):
expected = self._get_expected_breakpoints()
expected.labels = {"YRI": 0, "CEU": 1}
Expand Down

0 comments on commit 440672a

Please sign in to comment.