diff --git a/woltka/tests/test_align.py b/woltka/tests/test_align.py index 5300838..12a10a5 100644 --- a/woltka/tests/test_align.py +++ b/woltka/tests/test_align.py @@ -76,6 +76,14 @@ def _res2lst(res): (['R4', 'R5'], [{'G4'}, {'G5'}])) self.assertTupleEqual(_res2lst(obs), exp) + # chunk of 4 + aln.seek(0) + obs = plain_mapper(aln, n=4) + exp = ((['R1', 'R2', 'R3', 'R4'], + [{'G1'}, {'G1', 'G2'}, {'G1', 'G3'}, {'G4'}]), + (['R5'], [{'G5'}])) + self.assertTupleEqual(_res2lst(obs), exp) + # chunk of 5 aln.seek(0) obs = plain_mapper(aln, n=5) @@ -130,6 +138,14 @@ def _res2lst(res): self.assertListEqual(list(obs[0]), [x[0] for x in exp]) self.assertListEqual(list(obs[1]), [x[1] for x in exp]) + # chunk of 3 + aln.seek(0) + obs = _res2lst(range_mapper(aln, n=3)) + self.assertListEqual(list(obs[0][0]), [x[0] for x in exp[:3]]) + self.assertListEqual(list(obs[0][1]), [x[1] for x in exp[:3]]) + self.assertListEqual(list(obs[1][0]), [x[0] for x in exp[3:]]) + self.assertListEqual(list(obs[1][1]), [x[1] for x in exp[3:]]) + # specify format aln.seek(0) obs = _res2lst(range_mapper(aln, fmt='b6o'))[0]