Skip to content

Commit 783092b

Browse files
committed
BUG: make sure a call to signin updates global plotlycredentials
1 parent 608e0bd commit 783092b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/utils.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,15 @@ function signin(
5757
)
5858
global plotlycredentials = PlotlyCredentials(username, api_key)
5959

60+
61+
6062
# if endpoints are specified both the base and api domains must be
6163
# specified
6264
if endpoints != nothing
63-
try
64-
merge(DEFAULT_CONFIG, endpoints)
65-
catch
66-
error("You must specify both the base and api endpoints.")
65+
if !haskey(endpoints, "plotly_domain") || !haskey(endpoints, "plotly_api_domain")
66+
error("You must specify both the `plotly_domain` and `plotly_api_domain`")
6767
end
68+
global plotlyconfig = merge(DEFAULT_CONFIG, endpoints)
6869
end
6970
end
7071

test/test_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Plotly
22
using JSON
3-
using Base.Test
3+
using Test
44

55
#test signin only one endpoint specified
66
@test_throws ErrorException Plotly.signin("fake_username", "fake_api_key", Dict("plotly_domain"=>"test"))

0 commit comments

Comments
 (0)