Skip to content

Commit

Permalink
test_to_json_extension_design
Browse files Browse the repository at this point in the history
  • Loading branch information
UnHumbleBen committed Apr 25, 2022
1 parent 1433022 commit de44f47
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/scadnano_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4806,6 +4806,20 @@ def test_from_json_extension_design(self) -> None:
design = sc.Design.from_scadnano_json_str(json_str)
self.assertEqual(sc.Extension(5), design.strands[0].domains[1])

def test_to_json_extension_design(self) -> None:
# Setup
design = sc.Design(helices=[sc.Helix(max_offset=100)], strands=[], grid=sc.square)
design.draw_strand(0, 0).to(10).extension(5)

# Action
result = design.to_json()

# Verify
document = json.loads(result)
self.assertEqual(2, len(document["strands"][0]["domains"]))
self.assertIn("extension")
self.assertEqual(5, document["strands"][0]["domains"][1]["extension"])


class TestIllegalStructuresPrevented(unittest.TestCase):

Expand Down

0 comments on commit de44f47

Please sign in to comment.