def test_process_item_failure(self):
    api = MockOCLCClassifyAPI(self._db)
    api.queue_response(sample_data('isbn_not_found.xml', 'oclc_classify'))
    provider = IdentifierLookupCoverageProvider(self._default_collection, api=api)
    bad_id = self._identifier(Identifier.ISBN, '9781429984171')
    failure = provider.process_item(bad_id)
    assert (['http://classify.oclc.org/classify2/Classify?isbn=9781429984171'] == api.requests)
    assert isinstance(failure, CoverageFailure)
    assert (failure.exception == 'The work with ISBN 9781429984171 was not found.')
def test_process_item_failure(self):
    api = MockOCLCClassifyAPI(self._db)
    api.queue_response(sample_data('isbn_not_found.xml', 'oclc_classify'))
    provider = IdentifierLookupCoverageProvider(self._default_collection, api=api)
    bad_id = self._identifier(Identifier.ISBN, '9781429984171')
    failure = provider.process_item(bad_id)
    assert (['http://classify.oclc.org/classify2/Classify?isbn=9781429984171'] == api.requests)
    assert isinstance(failure, CoverageFailure)
    assert (failure.exception == 'The work with ISBN 9781429984171 was not found.')