Skip to content

Commit

Permalink
Merge pull request #220 from SynBioDex/219-windows-and-mac-builds
Browse files Browse the repository at this point in the history
Fix #219 to build on Windows and mac
  • Loading branch information
jakebeal authored Oct 12, 2023
2 parents 496421f + 9c5cf91 commit d468ade
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
build:
env:
IDT_CREDENTIALS: ${{ secrets.IDT_CREDENTIALS }}
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Default builds are on Ubuntu
Expand Down
2 changes: 2 additions & 0 deletions test/test_calculate_complexity_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def same_except_timestamps(doc1: sbol3.Document, doc2: sbol3.Document) -> bool:

class TestIDTCalculateComplexityScore(unittest.TestCase):

@unittest.skipIf(sys.platform == 'win32', reason='Not working on Windows https://github.com/SynBioDex/SBOL-utilities/issues/221')
def test_IDT_calculate_complexity_score(self):
"""Test that a library-call invocation of complexity scoring works"""
test_dir = Path(__file__).parent
Expand Down Expand Up @@ -66,6 +67,7 @@ def test_IDT_calculate_complexity_score(self):
scores = get_complexity_scores(sequences)
self.assertEqual(scores, {sequences[0]: 0})

@unittest.skipIf(sys.platform == 'win32', reason='Not working on Windows https://github.com/SynBioDex/SBOL-utilities/issues/221')
def test_commandline(self):
"""Test that a command-line invocation of complexity scoring works"""
test_dir = Path(__file__).parent
Expand Down
26 changes: 14 additions & 12 deletions test/test_sbol2_sbol3_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ def test_3to2_conversion(self):
doc2 = convert3to2(doc3, True)
#report = doc2.validate()
#self.assertEqual(len(report), 0, f'Validation failed: {report}')
with tempfile.NamedTemporaryFile(suffix='.xml') as tmp2:
doc2.write(tmp2.name)
self.assertFalse(file_diff(tmp2.name, str(TEST_FILES / 'BBa_J23101.xml')))
with tempfile.TemporaryDirectory() as tmpdir:
tmp2 = Path(tmpdir) / 'doc2.xml'
doc2.write(tmp2)
self.assertFalse(file_diff(str(tmp2), str(TEST_FILES / 'BBa_J23101.xml')))
doc3_loop = convert2to3(doc2, use_native_converter=True)
self.assertEqual(len(doc3_loop.validate()), 0)
with tempfile.NamedTemporaryFile(suffix='.nt') as tmp3:
doc3_loop.write(tmp3.name)
self.assertFalse(file_diff(tmp3.name, str(TEST_FILES / 'BBa_J23101_patched.nt')))
tmp3 = Path(tmpdir) / 'doc3_loop.nt'
doc3_loop.write(tmp3)
self.assertFalse(file_diff(str(tmp3), str(TEST_FILES / 'BBa_J23101_patched.nt')))

def test_2to3_conversion(self):
"""Test ability to convert a simple part from SBOL3 to SBOL2"""
Expand All @@ -41,15 +42,16 @@ def test_2to3_conversion(self):
# Convert to SBOL3 and check contents
doc3 = convert2to3(doc2, use_native_converter=True)
self.assertEqual(len(doc3.validate()), 0)
with tempfile.NamedTemporaryFile(suffix='.nt') as tmp3:
doc3.write(tmp3.name)
self.assertFalse(file_diff(tmp3.name, str(TEST_FILES / 'BBa_J23101_patched.nt')))
with tempfile.TemporaryDirectory() as tmpdir:
tmp3 = Path(tmpdir) / 'doc3.nt'
doc3.write(tmp3)
self.assertFalse(file_diff(str(tmp3), str(TEST_FILES / 'BBa_J23101_patched.nt')))
doc2_loop = convert3to2(doc3, True)
# report = doc2.validate()
# self.assertEqual(len(report), 0, f'Validation failed: {report}')
with tempfile.NamedTemporaryFile(suffix='.xml') as tmp2:
doc2_loop.write(tmp2.name)
self.assertFalse(file_diff(tmp2.name, str(TEST_FILES / 'BBa_J23101.xml')))
tmp2 = Path(tmpdir) / 'doc2_loop.xml'
doc2_loop.write(tmp2)
self.assertFalse(file_diff(str(tmp2), str(TEST_FILES / 'BBa_J23101.xml')))


if __name__ == '__main__':
Expand Down

0 comments on commit d468ade

Please sign in to comment.