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

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

src/w/e/WebTest-2.0.15/tests/test_forms.py   WebTest(Download)
    def test_button(self):
        form = self.callFUT()
        button = form['button']
        self.assertTrue(isinstance(button, Submit),
                        "<button> without type is a submit button")
 
        self.assertTrue(
            form['select']._forced_value is NoValue,
            "Setting a value after having forced a value should keep a forced"
            " state")
    def test_repr(self):
        form = self.callFUT()
        self.assertTrue(repr(form).startswith('<Form id='))
 
    def test_the_bs_node_must_not_change(self):
    def test_input(self):
        app = self.callFUT()
        res = app.get('/form.html')
        self.assertEqual(res.status_int, 200)
        self.assertTrue(res.content_type.startswith('text/html'))
    def test_input_unicode(self):
        app = self.callFUT('form_unicode_inputs.html')
        res = app.get('/form.html')
        self.assertEqual(res.status_int, 200)
        self.assertTrue(res.content_type.startswith('text/html'))

src/w/e/WebTest-2.0.15/tests/test_app.py   WebTest(Download)
 
        app = webtest.TestApp(cookie_app)
        self.assertTrue(not app.cookiejar,
                        'App should initially contain no cookies')
 
            return [to_bytes(body)]
        app = webtest.TestApp(cookie_app)
        self.assertTrue(not app.cookiejar,
                        'App should initially contain no cookies')
 
        mock_time.return_value = 1361464946.0
        app.get('/')
        self.assertTrue(app.cookies, 'Response should have set cookies')
 
        app = webtest.TestApp(cookie_app)
        self.assertTrue(not app.cookies,
                        'App should initially contain no cookies')
 
 
        app = webtest.TestApp(cookie_app)
        self.assertTrue(not app.cookies,
                        'App should initially contain no cookies')
 

src/w/e/WebTest-2.0.15/tests/test_lint.py   WebTest(Download)
            self.assertEqual(len(w), 1, "We should have only one warning")
            self.assertTrue(
                "QUERY_STRING" in str(w[-1].message),
                "The warning message should say something about QUERY_STRING")
 
            self.assertEqual(len(w), 1, "We should have only one warning")
            self.assertTrue(
                "REQUEST_METHOD" in str(w[-1].message),
                "The warning message should say something "
                "about REQUEST_METHOD")
        wrapper.close()
 
        self.assertTrue(mock.closed, "Original iterator has not been closed")
 
 
        error_wrapper.flush()
        self.assertTrue(
            fake_error.flushed,
            "ErrorWrapper should have called original wsgi_errors's flush")
 

src/e/v/evelink-HEAD/tests/test_api.py   evelink(Download)
 
        # Make sure the api key id and verification code were passed
        self.assertTrue(mock_urlopen.called)
        self.assertTrue(len(mock_urlopen.call_args[0]) > 0)
 
 
        result = self.api.get('foo/Bar', {'a':[1,2,3]})
        self.assertTrue(mock_urlopen.called)
        self.assertTrue(len(mock_urlopen.call_args[0]) > 0)
        self.assertEqual(

src/w/e/WebTest-2.0.15/tests/test_authorisation.py   WebTest(Download)
        resp.mustcontain('HTTP_AUTHORIZATION: Basic Z2F3ZWw6cGFzc3dk')
        header = resp.request.environ['HTTP_AUTHORIZATION']
        self.assertTrue(header.startswith('Basic '))
        authtype, value = header.split(' ')
        auth = (authtype,

src/w/e/WebTest-2.0.15/tests/test_debugapp.py   WebTest(Download)
        self.assertEqual(res.status_int, 200)
        self.assertEqual(res.headers['content-type'], 'text/plain')
        self.assertTrue(res.content_length > 0)
        self.assertEqual(res.body, to_bytes(''))
        res = self.app.head('/', xhr=True)
    def test_post_unicode_body(self):
        res = self.app.post(
            '/', params='é',
            content_type='text/plain; charset=utf8')
        self.assertTrue(res.body.endswith(b'\xc3\xa9'))

src/w/e/WebTest-2.0.15/tests/test_http.py   WebTest(Download)
    def test_shutdown_non_running(self):
        host, port = http.get_free_port()
        s = http.StopableWSGIServer(debug_app, host=host, port=port)
        self.assertFalse(s.wait(retries=-1))
        self.assertTrue(s.shutdown())