add a MockResponse
This commit is contained in:
parent
a239a18a8b
commit
6d70b79f27
|
@ -0,0 +1,12 @@
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
class MockResponse:
|
||||||
|
|
||||||
|
def __init__(self, data):
|
||||||
|
self.data = data
|
||||||
|
|
||||||
|
# mock json() method always returns a specific testing dictionary
|
||||||
|
# @staticmethod
|
||||||
|
def json(self):
|
||||||
|
return json.loads(self.data)
|
Loading…
Reference in New Issue