def testGetRecordWithRepositoryIdentifier(self): oaigetrecord = OaiGetRecord(OaiRepository(identifier='example.org')) record = CallTrace('record') record.identifier = 'id0' record.prefixes = ['oai_dc'] record.sets = [] record.isDeleted = False observer = CallTrace( returnValues={ 'isKnownPrefix': True, 'getRecord': record }, emptyGeneratorMethods=['oaiWatermark', 'oaiRecord']) oaigetrecord.addObserver(observer) consume( oaigetrecord.getRecord(arguments=dict( verb=['GetRecord'], metadataPrefix=['oai_dc'], identifier=['oai:example.org:id0'], ), **self.httpkwargs)) self.assertEqual( ['getRecord', 'isKnownPrefix', 'oaiWatermark', 'oaiRecord'], observer.calledMethodNames()) self.assertEqual(dict(identifier='id0', metadataPrefix='oai_dc'), observer.calledMethods[0].kwargs)
def testGetRecordWithRepositoryIdentifier(self): oaigetrecord = OaiGetRecord(OaiRepository(identifier='example.org')) record = CallTrace('record') record.identifier = 'id0' record.prefixes = ['oai_dc'] record.sets = [] record.isDeleted = False observer = CallTrace(returnValues={ 'isKnownPrefix': True, 'getRecord': record}, emptyGeneratorMethods=['oaiWatermark', 'oaiRecord']) oaigetrecord.addObserver(observer) consume(oaigetrecord.getRecord(arguments=dict( verb=['GetRecord'], metadataPrefix=['oai_dc'], identifier=['oai:example.org:id0'], ), **self.httpkwargs)) self.assertEquals(['getRecord', 'isKnownPrefix', 'oaiWatermark', 'oaiRecord'], observer.calledMethodNames()) self.assertEquals(dict(identifier='id0', metadataPrefix='oai_dc'), observer.calledMethods[0].kwargs)
def testGetRecordWithRepositoryIdentifier(self): oaigetrecord = OaiGetRecord(OaiRepository(identifier="example.org")) record = CallTrace("record") record.identifier = "id0" record.prefixes = ["oai_dc"] record.sets = [] record.isDeleted = False observer = CallTrace( returnValues={"getAllPrefixes": ["oai_dc"], "getRecord": record}, emptyGeneratorMethods=["oaiWatermark", "oaiRecord"], ) oaigetrecord.addObserver(observer) consume( oaigetrecord.getRecord( arguments=dict(verb=["GetRecord"], metadataPrefix=["oai_dc"], identifier=["oai:example.org:id0"]), **self.httpkwargs ) ) self.assertEquals(["getRecord", "getAllPrefixes", "oaiWatermark", "oaiRecord"], observer.calledMethodNames()) self.assertEquals(dict(identifier="id0"), observer.calledMethods[0].kwargs)