Skip to content

Commit

Permalink
tests for new repository wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
mittagessen committed Jan 13, 2025
1 parent 889f8bb commit 9b08313
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions tests/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class TestRepo(unittest.TestCase):
"""
Testing interaction with the model repository.
Testing our wrappers around HTRMoPo
"""

def setUp(self):
Expand All @@ -33,30 +33,11 @@ def test_get_description(self):
Tests fetching the description of a model.
"""
record = repo.get_description('10.5281/zenodo.8425684')
self.assertEqual(record['doi'], '10.5281/zenodo.8425684')

def test_get_model(self):
"""
Tests fetching a model.
"""
id = repo.get_model('10.5281/zenodo.8425684',
path=self.temp_model.name)
self.assertEqual(id, 'omnisyr_best.mlmodel')
self.assertEqual((self.temp_path / id).stat().st_size, 16245671)
self.assertEqual(record.doi, '10.5281/zenodo.8425684')

def test_prev_record_version_get_description(self):
"""
Tests fetching the description of a model that has a superseding newer version.
"""
record = repo.get_description('10.5281/zenodo.6657809')
self.assertEqual(record['doi'], '10.5281/zenodo.6657809')

def test_prev_record_version_get_model(self):
"""
Tests fetching a model that has a superseding newer version.
"""
id = repo.get_model('10.5281/zenodo.6657809',
path=self.temp_model.name)
self.assertEqual(id, 'HTR-United-Manu_McFrench.mlmodel')
self.assertEqual((self.temp_path / id).stat().st_size, 16176844)

self.assertEqual(record.doi, '10.5281/zenodo.6657809')

0 comments on commit 9b08313

Please sign in to comment.