コード例 #1
0
    def setup_class(cls):
        """ Setup for this test case"""

        # Create the test client
        cls.client = app.test_client()

        cls.payload = {'name': 'Harry', 'tags': [1, 2]}
コード例 #2
0
ファイル: test_view.py プロジェクト: proteanhq/protean-flask
def test_flask_view():
    """ Test that non Protean views work as before """
    # Create the test client
    client = app.test_client()

    rv = client.get('/flask-view')
    assert rv.status_code == 200
    assert rv.data == b'View Response'

    rv = client.get('/flask-view/abc')
    assert rv.status_code == 404
コード例 #3
0
 def client(self):
     """ Setup client for test cases """
     yield app.test_client()
コード例 #4
0
    def setup_class(cls):
        """ Setup for this test case"""

        # Create the test client
        cls.client = app.test_client()