def test__multiple(self):
    api = MockOCLCClassifyAPI(self._db)
    for filename in ('single_work_48446512.xml', 'single_work_48525129.xml'):
        api.queue_response(sample_data(filename, 'oclc_classify'))
    provider = IdentifierLookupCoverageProvider(self._default_collection, api=api)
    provider.parser = MockParserMulti()
    (tree, identifier) = (self._tree('multi'), self._id('multi'))
    metadata = self._blank_metadata(identifier)
    (code, owi_data) = provider.parser.initial_look_up(tree)
    provider._multiple(owi_data, metadata)
    result = provider.parser.called_with
    assert (provider.parser.call_count == 2)
    assert (result.primary_identifier.identifier == self.MULTI_ISBN)
    assert isinstance(result.primary_identifier, Identifier)
def test__multiple(self):
    api = MockOCLCClassifyAPI(self._db)
    for filename in ('single_work_48446512.xml', 'single_work_48525129.xml'):
        api.queue_response(sample_data(filename, 'oclc_classify'))
    provider = IdentifierLookupCoverageProvider(self._default_collection, api=api)
    provider.parser = MockParserMulti()
    (tree, identifier) = (self._tree('multi'), self._id('multi'))
    metadata = self._blank_metadata(identifier)
    (code, owi_data) = provider.parser.initial_look_up(tree)
    provider._multiple(owi_data, metadata)
    result = provider.parser.called_with
    assert (provider.parser.call_count == 2)
    assert (result.primary_identifier.identifier == self.MULTI_ISBN)
    assert isinstance(result.primary_identifier, Identifier)