File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -57,3 +57,13 @@ response_authenticate_success <- list(
57
57
job_id = NULL ,
58
58
token_creation_date = NULL
59
59
)
60
+
61
+ response_info_success <- list (
62
+ logged_in_user = " someone" ,
63
+ api_endpoint = " https://proof-api.fredhutch.org" ,
64
+ branch = " main" ,
65
+ commit_sha = " c4b85200632c2f9bd5e8173179208c3b32c7db7a" ,
66
+ short_commit_sha = " c4b85200" ,
67
+ commit_message = " two-eye lamb, as a so" ,
68
+ tag = " v.0.1.0"
69
+ )
Original file line number Diff line number Diff line change
1
+ test_that(" proof_info - success" , {
2
+ stub_request(" get" , make_url(" info" )) %> %
3
+ to_return(
4
+ body = jsonlite :: toJSON(response_info_success , auto_unbox = TRUE ),
5
+ status = 200L ,
6
+ headers = list (" Content-type" = " application/json" )
7
+ )
8
+
9
+ enable(quiet = TRUE )
10
+
11
+ withr :: with_envvar(c(" PROOF_TOKEN" = " notarealtoken" ), {
12
+ info_res <- proof_info()
13
+ })
14
+
15
+ expect_type(info_res , " list" )
16
+ expect_type(info_res $ logged_in_user , " character" )
17
+ expect_type(info_res $ api_endpoint , " character" )
18
+
19
+
20
+ stub_registry_clear()
21
+ disable(quiet = TRUE )
22
+ })
You can’t perform that action at this time.
0 commit comments