mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-27 02:30:17 +08:00
use cdn static files for unit tests
This commit is contained in:
parent
f7820e8ac3
commit
58da83db79
@ -130,7 +130,7 @@ def main():
|
|||||||
|
|
||||||
@app.route("/static/<path:path>", methods=["GET"])
|
@app.route("/static/<path:path>", methods=["GET"])
|
||||||
def static_resource(path):
|
def static_resource(path):
|
||||||
if app.interface.share:
|
if app.interface.share or os.getenv("GRADIO_TEST_MODE"):
|
||||||
return redirect(GRADIO_STATIC_ROOT + path)
|
return redirect(GRADIO_STATIC_ROOT + path)
|
||||||
else:
|
else:
|
||||||
return send_file(os.path.join(STATIC_PATH_LIB, path))
|
return send_file(os.path.join(STATIC_PATH_LIB, path))
|
||||||
|
@ -11,6 +11,7 @@ import random
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
current_dir = os.getcwd()
|
current_dir = os.getcwd()
|
||||||
|
os.environ["GRADIO_TEST_MODE"] = "1"
|
||||||
|
|
||||||
LOCAL_HOST = "http://localhost:{}"
|
LOCAL_HOST = "http://localhost:{}"
|
||||||
GOLDEN_PATH = "test/golden/{}/{}.png"
|
GOLDEN_PATH = "test/golden/{}/{}.png"
|
||||||
|
Loading…
Reference in New Issue
Block a user