Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/requests_mock/exceptions.py: 62%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

8 statements  

1# Licensed under the Apache License, Version 2.0 (the "License"); you may 

2# not use this file except in compliance with the License. You may obtain 

3# a copy of the License at 

4# 

5# https://www.apache.org/licenses/LICENSE-2.0 

6# 

7# Unless required by applicable law or agreed to in writing, software 

8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 

9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 

10# License for the specific language governing permissions and limitations 

11# under the License. 

12 

13 

14class MockException(Exception): 

15 """Base Exception for library""" 

16 

17 

18class NoMockAddress(MockException): 

19 """The requested URL was not mocked""" 

20 

21 def __init__(self, request): 

22 self.request = request 

23 

24 def __str__(self): 

25 return "No mock address: %s %s" % (self.request.method, 

26 self.request.url) 

27 

28 

29class InvalidRequest(MockException): 

30 """This call cannot be made under a mocked environment"""