def test_defaults_root_path_to_cwd(self): f = server.Flask('foo', settings={}) self.assertEqual(join(os.getcwd(), 'build'), f.static_folder)
def test_dispatches_to_helpers_setup_blueprint(self): with mock.patch.object(server, 'helpers') as helpers: f = server.Flask('foo') helpers.setup_blueprints.assert_called_with(f, None)
def test_provides_blueprints_to_setup_blueprints(self): blueprints = [mock.Mock(), mock.Mock()] with mock.patch.object(server, 'helpers') as helpers: f = server.Flask('foo', blueprints=blueprints) helpers.setup_blueprints.assert_called_with(f, blueprints)
def test_allows_dict_to_provide_settings(self): f = server.Flask('foo', settings={'ROOT_PATH': 'foo'}) self.assertEqual(join(os.getcwd(), 'foo', 'build'), f.static_folder)
def test_does_not_change_static_url_path_if_static_folder_present(self): f = server.Flask('foo', settings=__name__, static_folder='foo') self.assertEqual('/foo', f.static_url_path)
def test_defers_to_static_folder_if_present(self): f = server.Flask('foo', settings=__name__, static_folder='foo') self.assertEqual(join(os.getcwd(), 'foo'), f.static_folder)
def generate_server(self): return server.Flask('generated_server', settings=__name__)
def setUp(self): f = self.f = server.Flask(__name__, settings=__name__) f.config['TESTING'] = True