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

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

src/w/e/WebCore-HEAD/tests/test_basic.py   WebCore(Download)
    def test_hello(self):
        self.assertResponse('/', body="Hello world!\n")
 
 
class NestedController(PlainController):
    def test_paste_debug(self):
        self.assertResponse('/_test_vars')
 
    def test_index(self):
        self.assertResponse('/', body="success")
 
    def test_abnormal(self):
        """Test returning iterators."""
        self.assertResponse('/abnormal', body="it works")
        self.assertResponse('/yields', body="this works too")

src/w/e/WebCore-HEAD/tests/test_rest.py   WebCore(Download)
    def test_detection(self):
        self.assertResponse('/detect', _method='HEAD', body="")
        self.assertResponse('/detect', _method='GET', body="GET")
        self.assertResponse('/detect', _method='POST', body="POST")
        self.assertResponse('/detect', _method='PUT', body="PUT")
        self.assertResponse('/detect', _method='DELETE', body="DELETE")

src/w/e/WebCore-HEAD/tests/test_locale.py   WebCore(Download)
    def test_gettext(self):
        self.assertResponse('/gettext', _environ=self.environ, body='Tämä toimii!'.encode('utf-8'))
 
    def test_ugettext(self):
        self.assertResponse('/ugettext', _environ=self.environ, body='Tämä toimii!'.encode('utf-8'))
 
    def test_ngettext_1(self):
        self.assertResponse('/ngettext?n=1', _environ=self.environ, body='Yksikkö toimii!'.encode('utf-8'))
    def test_ngettext_2(self):
        self.assertResponse('/ngettext?n=2', _environ=self.environ, body='Monikko toimii!'.encode('utf-8'))
 
    def test_ungettext_1(self):
        self.assertResponse('/ungettext?n=1', _environ=self.environ, body='Yksikkö toimii!'.encode('utf-8'))

src/w/e/WebCore-HEAD/tests/test_db_sa.py   WebCore(Download)
    def test_index(self):
        self.assertResponse('/', body='success')
 
    def test_in_session(self):
        response = self.assertResponse('/in_session')
        assert response.body.startswith('<sqlalchemy.orm.session.Session'), response.body
 
    def test_http_exceptions(self):
        self.assertResponse('/http_ok', '200 OK', 'text/plain')
        self.assertResponse('/http_error', '500 Internal Server Error', 'text/plain')
    def test_http_exceptions(self):
        self.assertResponse('/http_ok', '200 OK', 'text/plain')
        self.assertResponse('/http_error', '500 Internal Server Error', 'text/plain')
        self.assertResponse('/http_exception', '204 No Content', 'text/html')
 

src/w/e/WebCore-HEAD/tests/test_rpc_json.py   WebCore(Download)
    def test_non_post(self):
        self.assertResponse('/', status='405 Method Not Allowed', content_type='text/plain')
 
    def test_private(self):
        self.assertRPCResponse('_add', status='501 Not Implemented', content_type='text/plain')

src/w/e/WebCore-HEAD/tests/test_routes.py   WebCore(Download)
    def test_basic(self):
        self.assertResponse('/', '404 Not Found', 'text/plain')
        self.assertResponse('/missing', '404 Not Found', 'text/plain')
        self.assertResponse('/error', '404 Not Found', 'text/plain')
        self.assertResponse('/error/', '404 Not Found', 'text/plain')
        self.assertResponse('/error/foo', '200 OK', 'text/html', body="u'foo'")

src/w/e/WebCore-HEAD/tests/test_auth.py   WebCore(Download)
    def test_index(self):
        self.assertResponse('/', body="success")
 
    def test_anonymous(self):
        self.assertResponse('/anonymous', body="anonymous")
        self.assertResponse('/authenticated', '307 Temporary Redirect', 'text/plain')
 
        for url, expected in pairs:
            self.assertResponse(url, body=expected)
 
    def test_deauthenticate(self):
        # TODO: Functional testing; ensure the session and thread-local are cleared.
        self.assertResponse('/kill', body="ok")

src/w/e/WebCore-HEAD/tests/test_crud.py   WebCore(Download)
    def test_basic(self):
        self.assertResponse('/', body="listing records")
        self.assertResponse('/create', body="creating a record")
 
    def test_object(self):
        self.assertResponse('/Dole/Bob/', body="viewing Bob Dole")
        self.assertResponse('/Dole/Bob/modify', body="modifying Bob Dole")
        self.assertResponse('/Dole/Bob/delete', body="deleting Bob Dole")

src/w/e/WebCore-HEAD/tests/test_url.py   WebCore(Download)
    def test_url_context(self):
        self.assertResponse('/', body="\nhttp://localhost/\n")