Skip to content

Commit

Permalink
Add move extension move test
Browse files Browse the repository at this point in the history
  • Loading branch information
UnHumbleBen committed Apr 16, 2022
1 parent f16b629 commit 2cdf023
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions tests/scadnano_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_strand__loopouts_with_labels_to_json(self) -> None:
self.assertEqual(1, len(design_from_json.strands))
self.assertEqual(expected_strand, design_from_json.strands[0])

def test_strand__extension_3p_from_to(self) -> None:
def test_strand__3p_extension(self) -> None:
design = self.design_6helix
sb = design.draw_strand(0, 0)
sb.to(10)
Expand All @@ -105,7 +105,7 @@ def test_strand__extension_3p_from_to(self) -> None:
self.assertEqual(1, len(design.strands))
self.assertEqual(expected_strand, design.strands[0])

def test_strand__extension_5p(self) -> None:
def test_strand__5p_extension(self) -> None:
design = self.design_6helix
sb = design.draw_strand(0, 0)

Expand All @@ -120,7 +120,7 @@ def test_strand__extension_5p(self) -> None:
self.assertEqual(1, len(design.strands))
self.assertEqual(expected_strand, design.strands[0])

def test_strand__update_to_after_extension_5p_ok(self) -> None:
def test_strand__update_to_after_5p_extension_ok(self) -> None:
design = self.design_6helix
sb = design.draw_strand(0, 0)

Expand All @@ -136,6 +136,21 @@ def test_strand__update_to_after_extension_5p_ok(self) -> None:
self.assertEqual(1, len(design.strands))
self.assertEqual(expected_strand, design.strands[0])

def test_strand__move_after_5p_extension_ok(self) -> None:
design = self.design_6helix
sb = design.draw_strand(0, 0)

sb.extension(5)
sb.move(15)

expected_strand: sc.Strand = sc.Strand([
sc.Extension(5),
sc.Domain(0, True, 0, 15),
])

self.assertEqual(1, len(design.strands))
self.assertEqual(expected_strand, design.strands[0])

def test_strand__lone_extension_should_not_add_strand(self) -> None:
design = self.design_6helix
sb = design.draw_strand(0, 0)
Expand All @@ -153,6 +168,15 @@ def test_strand__to_after_non_5p_extension_should_raise_error(self) -> None:
with self.assertRaises(sc.IllegalDesignError):
sb.to(15)

def test_strand__move_after_non_5p_extension_should_raise_error(self) -> None:
design = self.design_6helix
sb = design.draw_strand(0, 0)
sb.move(10)
sb.extension(5)

with self.assertRaises(sc.IllegalDesignError):
sb.move(5)

def test_strand__cross_after_extension_should_raise_error(self) -> None:
design = self.design_6helix
sb = design.draw_strand(0, 0)
Expand Down

0 comments on commit 2cdf023

Please sign in to comment.