File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed
Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1- include (" tests.jl" )
1+ include (" tests.jl" )
2+ include (" test_utils.jl" )
Original file line number Diff line number Diff line change @@ -2,3 +2,18 @@ using Plotly
22using JSON
33using Base. Test
44
5+ # test signin only one endpoint specified
6+ @test_throws ErrorException Plotly. signin (" fake_username" , " fake_api_key" , {" plotly_domain" => " test" })
7+
8+ # test signin and get_credentials
9+ Plotly. signin (" test_username" , " test_api_key" )
10+ creds = Plotly. get_credentials ()
11+ @test creds. username == " test_username"
12+ @test creds. api_key == " test_api_key"
13+
14+ # test signin + endpoints and get_config
15+ endpoints = {" plotly_domain" => " my_plotly_domain" , " plotly_api_domain" => " my_plotly_api_domain" }
16+ Plotly. signin (" test_username" , " test_api_key" , endpoints)
17+ config = Plotly. get_config ()
18+ @test config. plotly_domain == " my_plotly_domain"
19+ @test config. plotly_api_domain== " my_plotly_api_domain"
Original file line number Diff line number Diff line change @@ -37,3 +37,17 @@ figure = Plotly.getFile("5", "chris")
3737
3838response = Plotly. plot (figure[" data" ], [" layout" => figure[" layout" ], " filename" => " test_get_figure_plot" ])
3939@test response[" error" ] == " "
40+
41+ # test get_plot_endpoint
42+ endpoints = {" plotly_domain" => " my_plotly_domain" , " plotly_api_domain" => " my_plotly_api_domain" }
43+ Plotly. signin (" test_username" , " test_api_key" , endpoints)
44+ plot_endpoint = Plotly. get_plot_endpoint ()
45+ @test plot_endpoint == " my_plotly_domain/clientresp"
46+
47+ # test get_content_endpoint
48+ endpoints = {" plotly_domain" => " my_plotly_domain" , " plotly_api_domain" => " my_plotly_api_domain" }
49+ Plotly. signin (" test_username" , " test_api_key" , endpoints)
50+ fid = " 123_fake"
51+ owner = " test_owner"
52+ content_endpoint = Plotly. get_content_endpoint (fid, owner)
53+ @test content_endpoint == " my_plotly_api_domain/files/test_owner:123_fake/content"
You can’t perform that action at this time.
0 commit comments