<s> from pytest import raises <EOL> import pytest <EOL> from epo_ops . exceptions import ( <EOL> AnonymousQuotaPerDayExceeded , AnonymousQuotaPerMinuteExceeded , <EOL> IndividualQuotaPerHourExceeded , RegisteredQuotaPerWeekExceeded <EOL> ) <EOL> from epo_ops . models import Docdb <EOL> from . secrets import APIARY_URL <EOL> def issue_request ( client ) : <EOL> return client . published_data ( <EOL> '<STR_LIT>' , <EOL> Docdb ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> ) <EOL> def test_mock_quota_exceeded ( all_clients , monkeypatch ) : <EOL> monkeypatch . setattr ( <EOL> all_clients , '<STR_LIT>' , APIARY_URL <EOL> ) <EOL> errors = { <EOL> '<STR_LIT>' : AnonymousQuotaPerMinuteExceeded , <EOL> '<STR_LIT>' : AnonymousQuotaPerDayExceeded , <EOL> '<STR_LIT>' : IndividualQuotaPerHourExceeded , <EOL> '<STR_LIT>' : RegisteredQuotaPerWeekExceeded , <EOL> } <EOL> for path , exception_class in errors . items ( ) : <EOL> monkeypatch . setattr ( <EOL> all_clients , '<STR_LIT>' , path <EOL> ) <EOL> with raises ( exception_class ) : <EOL> issue_request ( all_clients ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> pytest . main ( ) </s>
