Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #219 to build on Windows and mac #220

Merged
merged 4 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading