def test_prepare_positions_start_too_high2(self): with self.assertRaisesRegex(ValueError, 'Start.*should be smaller.*alignment'): _prepare_positions(22, None, 20)
def test_prepare_positions_start_too_high1(self): with self.assertRaisesRegex(ValueError, 'Start.*should be smaller.*end position'): _prepare_positions(18, 10, 20)
def test_prepare_positions_end_too_high(self): pos_start, pos_end, aln_len = 4, 24, 20 obs_pos = _prepare_positions(pos_start, pos_end, aln_len) exp_pos = {"start": 3, "end": 20} self.assertDictEqual(obs_pos, exp_pos)
def test_prepare_positions_both_none(self): with self.assertRaisesRegex( ValueError, 'Neither primers nor.*positions were provided'): _prepare_positions(None, None, 20)
def test_prepare_positions_no_end(self): pos_start, pos_end, aln_len = 4, None, 20 obs_pos = _prepare_positions(pos_start, pos_end, aln_len) exp_pos = {"start": 3, "end": None} self.assertDictEqual(obs_pos, exp_pos)