Skip to content

Commit

Permalink
test_nick_on_extension
Browse files Browse the repository at this point in the history
  • Loading branch information
UnHumbleBen committed Apr 23, 2022
1 parent 3615afb commit 2feed8a
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/scadnano_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3381,6 +3381,40 @@ def test_add_half_crossover_on_extension_error(self) -> None:
with self.assertRaises(sc.IllegalDesignError):
design.add_half_crossover(0, 1, 0, True)

def test_nick_on_extension(self) -> None:
"""
Before:
/
/
/
0 [-------
After:
/
/
/
0 [-->[---
"""
# Setup
design: sc.Design = sc.Design(helices=[sc.Helix(max_offset=100), sc.Helix(max_offset=100)])
design.draw_strand(0, 0).extension(5).to(8)

# Nick
design.add_nick(0, 4, True)

# Verification
expected_strand1: sc.Strand = sc.Strand([
sc.Domain(0, True, 0, 4),
])
expected_strand2: sc.Strand = sc.Strand([
sc.Domain(0, True, 4, 8),
sc.Extension(5)
])
self.assertEquals(2, len(design.strands))
self.assertIn(expected_strand1, design.strands)
self.assertIn(expected_strand2, design.strands)

class TestAutocalculatedData(unittest.TestCase):

Expand Down

0 comments on commit 2feed8a

Please sign in to comment.