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

Make test_init and test_dracor_info less strict #26

Open
cmil opened this issue Jan 8, 2024 · 0 comments
Open

Make test_init and test_dracor_info less strict #26

cmil opened this issue Jan 8, 2024 · 0 comments

Comments

@cmil
Copy link
Member

cmil commented Jan 8, 2024

The tests test_init and test_dracor_info are too specific and will fail as soon as a minor upgrade is made to the DraCor API.

def test_init(self):
self.assertEqual(self.dracor.name, "DraCor API v1")
self.assertEqual(self.dracor.status, "beta")
self.assertEqual(self.dracor.existdb, "6.2.0")
self.assertEqual(self.dracor.version, "1.0.0")

def test_dracor_info(self):
self.assertEqual(self.dracor.dracor_info(),{
'name': 'DraCor API v1',
'version': '1.0.0',
'status': 'beta',
'existdb': '6.2.0',
'base': 'https://dracor.org/api/v1'})

I suggest the following adjustments:

  • only assert that that the major number of version is 1, the tests should succeed for any 1.x.x version
  • allow the following values for status: "stable", "beta", "alpha" or ignore this property altogether since it should not really matter to pydracor (it will change to "stable" with the next production update, we forgot to change it for the 1.0 release)
  • do not make any assertions about the existdb version, it can change in no predictable ways and should be irrelevant for pydracor
  • allow for other properties of the info object to occur (hint: the next API update will add the URL to the OpenAPI documentation)
@cmil cmil mentioned this issue Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant