-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathdash_creation.jl
111 lines (82 loc) · 4.36 KB
/
dash_creation.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using Test
using Dash
@testset "default args" begin
app = dash()
@test app.root_path == pwd()
@test isempty(app.config.external_stylesheets)
@test isempty(app.config.external_scripts)
@test app.config.requests_pathname_prefix == "/"
@test app.config.routes_pathname_prefix == "/"
@test app.config.assets_folder == "assets"
@test app.config.assets_url_path == "assets"
@test app.config.assets_ignore == ""
@test app.config.serve_locally == true
@test app.config.suppress_callback_exceptions == false
@test app.config.eager_loading == false
@test isempty(app.config.meta_tags)
@test app.index_string == Dash.default_index
@test app.config.assets_external_path === nothing
@test app.config.include_assets_files == true
@test app.config.show_undo_redo == false
end
@testset "setted args" begin
app = dash(; external_stylesheets=["https://test.css"])
@test app.config.external_stylesheets == ["https://test.css"]
app = dash(; external_stylesheets=[Dict("url" => "https://test.css", "integrity" => "integrity")])
@test app.config.external_stylesheets == [
Dict("url" => "https://test.css", "integrity" => "integrity")
]
app = dash(; external_scripts = ["http://test.js"])
@test app.config.external_scripts == ["http://test.js"]
app = dash(; external_scripts=[Dict("url" => "https://test.js", "integrity" => "integrity")])
@test app.config.external_scripts == [
Dict("url" => "https://test.js", "integrity" => "integrity")
]
app = dash(; url_base_pathname = "/base/")
@test app.config.url_base_pathname == "/base/"
@test app.config.requests_pathname_prefix == "/base/"
@test app.config.routes_pathname_prefix == "/base/"
app = dash(; requests_pathname_prefix = "/prefix/")
@test app.config.requests_pathname_prefix == "/prefix/"
@test app.config.routes_pathname_prefix == "/"
app = dash(; routes_pathname_prefix = "/prefix/")
@test app.config.requests_pathname_prefix == "/prefix/"
@test app.config.routes_pathname_prefix == "/prefix/"
app = dash(; requests_pathname_prefix = "/reg/prefix/", routes_pathname_prefix = "/prefix/")
@test app.config.requests_pathname_prefix == "/reg/prefix/"
@test app.config.routes_pathname_prefix == "/prefix/"
@test_throws ErrorException app = dash(; url_base_pathname = "/base")
@test_throws ErrorException app = dash(; url_base_pathname = "base/")
@test_throws ErrorException app = dash(; url_base_pathname = "/", routes_pathname_prefix = "/prefix/")
@test_throws ErrorException app = dash(; requests_pathname_prefix = "/prefix")
@test_throws ErrorException app = dash(; routes_pathname_prefix = "/prefix")
@test_throws ErrorException app = dash(; requests_pathname_prefix = "prefix/")
@test_throws ErrorException app = dash(; routes_pathname_prefix = "prefix/")
@test_throws ErrorException app = dash(; requests_pathname_prefix = "/reg/prefix/", routes_pathname_prefix = "/ix/")
app = dash(; assets_folder = "images")
@test app.config.assets_folder == "images"
app = dash(; assets_url_path = "/images")
@test app.config.assets_url_path == "images"
app = dash(; assets_ignore = "ignore")
@test app.config.assets_ignore == "ignore"
app = dash(; serve_locally = false)
@test app.config.serve_locally == false
app = dash(; suppress_callback_exceptions = true)
@test app.config.suppress_callback_exceptions == true
app = dash(; eager_loading = false)
@test app.config.eager_loading == false
app = dash(; meta_tags = [Dict(["name"=>"test", "content" => "content"])])
@test app.config.meta_tags == [Dict(["name"=>"test", "content" => "content"])]
@test_throws ErrorException app = dash(; index_string = "<html></html>")
app = dash(; index_string = "<html>{%app_entry%}{%config%}{%scripts%}</html>")
@test app.index_string == "<html>{%app_entry%}{%config%}{%scripts%}</html>"
app = dash(; assets_external_path = "external")
@test app.config.assets_external_path == "external"
app = dash(; include_assets_files = true)
@test app.config.include_assets_files == true
app = dash(; show_undo_redo = false)
@test app.config.show_undo_redo == false
@test app.config.prevent_initial_callbacks == false
app = dash(; prevent_initial_callbacks = true)
@test app.config.prevent_initial_callbacks == true
end