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

All Samples(93)  |  Call(93)  |  Derive(0)  |  Import(0)

src/k/r/krankshaft-0.3.6/tests/krankshaft/test_api.py   krankshaft(Download)
            self.api.abort(request, 401)
        except Exception, exc:
            self.assertEquals(401, exc.response.status_code)
 
        response = self.api.response(request, 401)
        try:
            self.api.abort(response)
        except Exception, exc:
            self.assertEquals(response, exc.response)
    def test_auth_deny(self):
        response = self.client.get('/deny/?key=value')
        self.assertEquals(response.status_code, 401)
        self.assertTrue(not response.content)
 
    def test_auth_deny_decorator_only(self):
        response = self.client.get('/deny-decorator-only/?key=value')
        self.assertEquals(response.status_code, 200)
        self.assertEquals(
            response['Content-Type'].split(';')[0],

src/k/r/krankshaft-0.3.6/tests/krankshaft/test_throttle.py   krankshaft(Download)
    def test_allow(self):
        self.assertEquals(self.throttle.allow(), (True, {}))
 
    def test_allow_suffix(self):
        self.assertEquals(self.throttle.allow('suffix'), (True, {}))
    def test_allow(self, wait=None):
        wait = wait or (13, )
        self.assertEquals(self.throttle.allow(), (True, {}))
 
        allowed, headers = self.throttle.allow()
        self.assertEquals(allowed, False)
        self.throttle.timer = lambda: self.now + headers['Retry-After']
        allowed, headers = self.throttle.allow()
        self.assertEquals(allowed, True)
        self.assertTrue(not headers)
 

src/k/r/krankshaft-0.3.6/tests/krankshaft/test_serializer.py   krankshaft(Download)
    def do(self, obj, expect):
        self.assertEquals(expect, self.serializer.convert(obj))
 
    def setUp(self):
        self.serializer = Serializer()
    def test_primitive(self):
        for value in self.serializer.primitive_values + (1, 1L, 1.1, 'a', u'a'):
            self.assertEquals(value, self.serializer.convert(value))
 
    def test_serializer_default_content_type(self):
        serializer = Serializer(
            default_content_type='application/json'
        )
        content, content_type = serializer.serialize({'key': 'value'})
        self.assertEquals(content, '{"key": "value"}')
        content, content_type = serializer.serialize({'key': 'value'})
        self.assertEquals(content, '{"key": "value"}')
        self.assertEquals(content_type, 'application/json')
 
    def test_time(self):
    def test_application_json(self):
        content, content_type = \
            self.serializer.serialize(self.data, 'application/json')
        self.assertEquals(content_type, 'application/json')
        self.assertEquals(