kopia lustrzana https://github.com/snarfed/bridgy-fed
updates for appengine_info changes, LOCAL => LOCAL_SERVER etc
snarfed/webutil@722053854a through snarfed/webutil@86d89bd3dfpull/634/head
rodzic
f116dbfa26
commit
0bb1038c3a
|
|
@ -2,6 +2,7 @@
|
|||
import json
|
||||
import logging
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
from flask import Flask, g
|
||||
from flask_caching import Cache
|
||||
|
|
@ -31,7 +32,9 @@ app.config.from_pyfile(app_dir / 'config.py')
|
|||
app.url_map.converters['regex'] = flask_util.RegexConverter
|
||||
app.after_request(flask_util.default_modern_headers)
|
||||
app.register_error_handler(Exception, flask_util.handle_exception)
|
||||
if appengine_info.LOCAL:
|
||||
if (appengine_info.LOCAL_SERVER
|
||||
# ugly hack to infer if we're running unit tests
|
||||
and 'unittest' not in sys.modules):
|
||||
flask_gae_static.init_app(app)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ from granary.tests.test_as1 import (
|
|||
)
|
||||
from oauth_dropins.webutil import testutil, util
|
||||
from oauth_dropins.webutil.appengine_config import ndb_client
|
||||
from oauth_dropins.webutil import appengine_info
|
||||
from oauth_dropins.webutil.testutil import requests_response
|
||||
import requests
|
||||
|
||||
|
|
@ -157,6 +158,7 @@ class TestCase(unittest.TestCase, testutil.Asserts):
|
|||
def setUp(self):
|
||||
super().setUp()
|
||||
|
||||
appengine_info.LOCAL_SERVER = False
|
||||
app.testing = True
|
||||
cache.clear()
|
||||
protocol.seen_ids.clear()
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue