Skip to content

Commit 8dd570d

Browse files
committed
Reindent and document
1 parent 48c0bd7 commit 8dd570d

File tree

2 files changed

+30
-32
lines changed

2 files changed

+30
-32
lines changed

R/plotly.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' py$plotly({data1[, data2, ...]}, kwargs=kwargs), py$ggplotly()
1212
#' \item Styling Data: py$style(data1,data2,..., kwargs=kwargs)
1313
#' \item Styling Layout: py$layout(layout, kwargs=kwargs)
14-
#' \item Utilities: py$get_figure()
14+
#' \item Utilities: py$get_figure(file_owner, file_id)
1515
#' }
1616
#'
1717
#' @import knitr
Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,42 @@
11
context("get_figure")
22

33
test_that("requests made by a user who doesn't exist error a 404", {
4-
py <- plotly("user_does_not_exist", "api_key_shouldnt_matter")
5-
expect_error({
6-
py$get_figure("get_test_user", 0);
7-
}, "404")
8-
});
4+
py <- plotly("user_does_not_exist", "api_key_shouldnt_matter")
5+
expect_error({
6+
py$get_figure("get_test_user", 0)
7+
}, "404")
8+
})
99

1010
test_that("requests made to retrieve a file that doesn't error return a 404", {
11-
py <- plotly("get_test_user", "vgs6e0cnoi")
12-
expect_error({
13-
py$get_figure("get_test_user", 1000);
14-
}, "404")
15-
});
11+
py <- plotly("get_test_user", "vgs6e0cnoi")
12+
expect_error({
13+
py$get_figure("get_test_user", 1000)
14+
}, "404")
15+
})
1616

1717
test_that("requests made with the wrong API key error a 401", {
18-
py <- plotly("get_test_user", "some_invalid_api_key")
19-
expect_error({
20-
py$get_figure("get_test_user", 1);
21-
}, "401")
22-
});
18+
py <- plotly("get_test_user", "some_invalid_api_key")
19+
expect_error({
20+
py$get_figure("get_test_user", 1)
21+
}, "401")
22+
})
2323

2424
test_that("requests made to retrieve some elses private file errors a 403", {
25-
py <- plotly("get_test_user_2", "0f9es4r6tm")
26-
expect_error({
27-
py$get_figure("get_test_user", 1);
28-
}, "403")
29-
});
25+
py <- plotly("get_test_user_2", "0f9es4r6tm")
26+
expect_error({
27+
py$get_figure("get_test_user", 1)
28+
}, "403")
29+
})
3030

3131
test_that("requests made to retrieve some elses private file errors a 403", {
32-
py <- plotly("get_test_user_2", "0f9es4r6tm")
33-
expect_error({
34-
py$get_figure("get_test_user", 1);
35-
}, "403")
36-
});
32+
py <- plotly("get_test_user_2", "0f9es4r6tm")
33+
expect_error({
34+
py$get_figure("get_test_user", 1)
35+
}, "403")
36+
})
3737

3838
test_that("retrieving a public figure ... works.", {
39-
py <- plotly("get_test_user_2", "0f9es4r6tm")
40-
figure = py$get_figure("get_test_user", 0);
41-
42-
expect_equivalent(figure$data[[1]]$x, list("1", "2", "3"))
43-
44-
});
39+
py <- plotly("get_test_user_2", "0f9es4r6tm")
40+
figure <- py$get_figure("get_test_user", 0)
41+
expect_equivalent(figure$data[[1]]$x, list("1", "2", "3"))
42+
})

0 commit comments

Comments
 (0)