Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
manulera authored and BjornFJohansson committed Jul 2, 2024
1 parent 11b57f1 commit 7da9281
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions tests/test_module_dseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ def test_left_end_position():

def test_apply_cut():
from pydna.dseq import Dseq
from Bio.Restriction import EcoRI, BamHI

seq = Dseq('aaGAATTCaa', circular=False)

Expand Down Expand Up @@ -876,31 +877,31 @@ def test_apply_cut():
# Overlapping cuts should return an error
seq = Dseq('aaGAATTCaa', circular=True)
first_cuts = [
((3, -4), None),
((7, 4), None),
((3, -4), BamHI),
((7, 4), BamHI),
# Spanning the origin
((9, -8), None),
((8, 8), None),
((9, -8), BamHI),
((8, 8), BamHI),
]

overlapping_cuts = [
((4, -4), None),
((2, -4), None),
((2, -6), None),
((8, 4), None),
((6, 4), None),
((8, 6), None),
((4, -4), EcoRI),
((2, -4), EcoRI),
((2, -6), EcoRI),
((8, 4), EcoRI),
((6, 4), EcoRI),
((8, 6), EcoRI),
# Spanning the origin
((7, -8), None),
((6, 8), None),
((7, -8), EcoRI),
((6, 8), EcoRI),
]

for first_cut in first_cuts:
for second_cut in overlapping_cuts:
try:
seq.apply_cut(first_cut, second_cut)
except ValueError as e:
assert e.args[0] == 'Cuts overlap'
assert e.args[0] == 'Cuts by BamHI EcoRI overlap.'
else:
print(first_cut, second_cut)
assert False, 'Expected ValueError'
Expand Down

0 comments on commit 7da9281

Please sign in to comment.