예제 #1
0
 def test_defaults_root_path_to_cwd(self):
     f = server.Flask('foo', settings={})
     self.assertEqual(join(os.getcwd(), 'build'), f.static_folder)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 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)
예제 #6
0
 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)
예제 #7
0
 def generate_server(self):
     return server.Flask('generated_server', settings=__name__)
예제 #8
0
 def setUp(self):
     f = self.f = server.Flask(__name__, settings=__name__)
     f.config['TESTING'] = True