Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import json
import logging
import os
import requests
import sys
import unittest
if sys.version_info.major < 3:
import backports.unittest_mock
backports.unittest_mock.install()
from unittest.mock import MagicMock, patch, call
import pdpyras
pdpyras.APISession.raise_if_http_error = True
class Session(object):
"""
Python reqeusts.Session mockery class
"""
request = None
headers = None
class Response(object):
"""Mock class for emulating requests.Response objects
Look for existing use of this class for examples on how to use.
"""
def __init__(self, code, text, method='GET', url=None):
super(Response, self).__init__()