Skip to content

Commit a39c907

Browse files
add tests for getFile
1 parent 15eff19 commit a39c907

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

test/tests.jl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,31 @@ Plotly.signin("unittest","tfzz811f5n")
99
(x0,y0) = [1,2,3], [4,5,6]
1010
(x1,y1) = [1,2,3], [2,10,12]
1111

12-
response = Plotly.plot([[x0 y0] [x1 y1]])
12+
response = Plotly.plot([[x0 y0] [x1 y1]], ["filename" => "basic_test_plot"])
1313
@test response["error"] == ""
1414

1515
datastyle = ["line"=>["color"=> "rgb(84, 39, 143)", "width"=> 4]]
16-
style_res = Plotly.style(datastyle)
16+
style_res = Plotly.style(datastyle, ["filename" => "basic_test_plot"])
1717
@test style_res["error"] == ""
1818

19-
layout_res = Plotly.layout(["title"=>"Hello World"])
19+
layout_res = Plotly.layout(["title"=>"Hello World"], ["filename" => "basic_test_plot"])
2020
@test layout_res["error"] == ""
2121

2222
# just check that these won't raise an error
2323
trace1 = Plotly.line(sin, ["left"=>0, "right"=>10, "step"=>1])
2424
trace2 = Plotly.histogram(cos, ["left"=>0, "right"=>10, "step"=>1])
2525
trace3 = Plotly.box(abs, ["left"=>0, "right"=>10, "step"=>1])
2626
trace4 = Plotly.scatter(log, ["left"=>0, "right"=>10, "step"=>1])
27-
response = Plotly.plot([trace1, trace2, trace3, trace4])
27+
response = Plotly.plot([trace1, trace2, trace3, trace4], ["filename" => "test_plot"])
2828
@test response["error"] == ""
2929

3030
# and one last check
31-
response = Plotly.plot([sin, cos, abs, log], ["left"=>eps(), "right"=>10, "step"=>1])
32-
@test response["error"] == ""
31+
response = Plotly.plot([sin, cos, abs, log], ["left"=>eps(), "right"=>10, "step"=>1, "filename" => "test_plot"])
32+
@test response["error"] == ""
33+
34+
figure = Plotly.getFile("5", "chris")
35+
@test length(figure["data"][1]["x"]) == 501
36+
@test haskey(figure["layout"], "xaxis")
37+
38+
response = Plotly.plot(figure["data"], ["layout"=> figure["layout"], "filename" => "test_get_figure_plot"])
39+
@test response["error"] == ""

0 commit comments

Comments
 (0)