Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

src/d/j/django-paypal-adaptive-0.2.2/paypaladaptive/tests/helpers.py   django-paypal-adaptive(Download)
import django.test as test
 
from mock import patch
 
from ..api.httpwrapper import UrlRequest, UrlResponse
 
class MockIPNVerifyRequest(UrlRequest):
    def call(self, url, data=None, headers=None):
        MockIPNVerifyRequest.data = data
        self._response = UrlResponse(data='VERIFIED', meta={}, code=200)
    def call(self, url, data=None, headers=None):
        self.data = data
        self._response = UrlResponse(data='invalid', meta={}, code=200)
        return self
 
    def call(self, url, data=None, headers=None):
        self.data = data
        self._response = UrlResponse(data='invalid', meta={}, code=None)
        return self
 
    def call(self, url, data=None, headers=None):
        self.data = data
        self._response = UrlResponse(data='VERIFIED', meta={}, code=500)
        return self
 

src/d/j/django-paypal-adaptive-HEAD/paypaladaptive/tests/helpers.py   django-paypal-adaptive(Download)
import django.test as test
 
from mock import patch
 
from ..api.httpwrapper import UrlRequest, UrlResponse
 
class MockIPNVerifyRequest(UrlRequest):
    def call(self, url, data=None, headers=None):
        MockIPNVerifyRequest.data = data
        self._response = UrlResponse(data='VERIFIED', meta={}, code=200)
    def call(self, url, data=None, headers=None):
        self.data = data
        self._response = UrlResponse(data='invalid', meta={}, code=200)
        return self
 
    def call(self, url, data=None, headers=None):
        self.data = data
        self._response = UrlResponse(data='invalid', meta={}, code=None)
        return self
 
    def call(self, url, data=None, headers=None):
        self.data = data
        self._response = UrlResponse(data='VERIFIED', meta={}, code=500)
        return self