Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Commit

Permalink
Update minimal_api.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jkesanie authored Jun 1, 2018
1 parent 6fceb94 commit 73353bc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/metax_api/tests/api/oaipmh/minimal_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,18 @@ def test_list_sets(self):
self.assertEquals(len(sets), 4)

def test_list_identifiers(self):
ms = settings.OAI['BATCH_SIZE']
allRecords = CatalogRecord.objects.filter(
data_catalog__catalog_json__identifier__in=MetaxOAIServer._get_default_set_filter(None))[:settings.OAI['BATCH_SIZE']]
data_catalog__catalog_json__identifier__in=MetaxOAIServer._get_default_set_filter(None))[:ms]
response = self.client.get('/oai/?verb=ListIdentifiers&metadataPrefix=oai_dc')
self.assertEqual(response.status_code, status.HTTP_200_OK)
headers = self._get_results(response.content, '//o:header')
self.assertTrue(len(headers) == len(allRecords), len(headers))

def test_list_records(self):
ms = settings.OAI['BATCH_SIZE']
allRecords = CatalogRecord.objects.filter(
data_catalog__catalog_json__identifier__in=MetaxOAIServer._get_default_set_filter(None))[:settings.OAI['BATCH_SIZE']]
data_catalog__catalog_json__identifier__in=MetaxOAIServer._get_default_set_filter(None))[:ms]

response = self.client.get('/oai/?verb=ListRecords&metadataPrefix=oai_dc')
self.assertEqual(response.status_code, status.HTTP_200_OK)
Expand Down Expand Up @@ -183,8 +185,9 @@ def test_get_urnresolver_record(self):
self.assertTrue(len(identifiers) == 1, response.content)

def test_list_records_from_datasets_set(self):
ms = settings.OAI['BATCH_SIZE']
allRecords = CatalogRecord.objects.filter(
data_catalog__catalog_json__identifier__in=MetaxOAIServer._get_default_set_filter(None))[:settings.OAI['BATCH_SIZE']]
data_catalog__catalog_json__identifier__in=MetaxOAIServer._get_default_set_filter(None))[:ms]

response = self.client.get('/oai/?verb=ListRecords&metadataPrefix=oai_dc&set=datasets')
self.assertEqual(response.status_code, status.HTTP_200_OK)
Expand Down

0 comments on commit 73353bc

Please sign in to comment.