#!/usr/bin/env python3 from getpost import create_app from getpost.config import DevConfig app = create_app(DevConfig) app.run()
from nose import with_setup from nose.tools import eq_ from getpost.config import TestConfig from getpost import create_app app = create_app(TestConfig) def setup_func(): "set up pre-test configurations" app.config['TESTING'] = True def teardown_func(): "tear down pre-test configurations" app.config['TESTING'] = False @with_setup(setup=setup_func, teardown=teardown_func) def test_index(): test_app = app.test_client() rv = test_app.get('/') rv_string = rv.data.decode('utf-8') eq_( rv_string, '<h1>What the brangan.</h1>', 'Response string not identical' )
Flags: -s, --nocapture Don't capture stdout. -v=DEFAULT, --verbose=DEFAULT Be more verbose. """ from selenium import webdriver from getpost.config import TestConfig from getpost import create_app app = create_app(TestConfig) driver = webdriver.Firefox() def setup_package(): "set up pre-test configurations" app.config['TESTING'] = True def teardown_package(): "tear down pre-test configurations" app.config['TESTING'] = False driver.close() from tests.hogwarts import *