Skip to content

Commit

Permalink
Fix some json and cadnano tests
Browse files Browse the repository at this point in the history
  • Loading branch information
UnHumbleBen committed May 14, 2022
1 parent 43e06bf commit 9b9e401
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions scadnano/scadnano.py
Original file line number Diff line number Diff line change
Expand Up @@ -5668,6 +5668,9 @@ def to_cadnano_v2_serializable(self, name: str = '') -> Dict[str, Any]:
'''
for strand in self.strands:
for domain in strand.domains:
if isinstance(domain, Extension):
raise ValueError(
'We cannot handle designs with Extensions as it is not a cadnano v2 concept')
if isinstance(domain, Loopout):
raise ValueError(
'We cannot handle designs with Loopouts as it is not a cadnano v2 concept')
Expand Down
6 changes: 3 additions & 3 deletions tests/scadnano_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,9 +1576,9 @@ def test_extension(self) -> None:
"""
design: sc.Design = sc.Design(helices=[sc.Helix(max_offset=100)], grid=Grid.square)
sb = design.draw_strand(0, 0)

sb.extension_3p(5)
sb.to(10)
sb.as_scaffold()
sb.extension_3p(5)

with self.assertRaises(ValueError) as context:
design.to_cadnano_v2_json()
Expand Down Expand Up @@ -1671,7 +1671,7 @@ def test_from_json__three_strands(self) -> None:
scaf_loop = scaf.domains[2]
scaf_ss2 = scaf.domains[3]

self.assertEqual(3, scaf_loop.num_bases)
self.assertEqual(3, scaf_loop.length)

self.assertEqual(1, st_l_ss0.helix)
self.assertEqual(0, st_l_ss1.helix)
Expand Down

0 comments on commit 9b9e401

Please sign in to comment.