зеркало из https://github.com/Azure/AzureGraph.git
update tests
This commit is contained in:
Родитель
62e017aea0
Коммит
10a814291a
|
@ -17,7 +17,7 @@ test_that("Graph authentication works",
|
|||
expect_true(is_azure_token(gr$token))
|
||||
|
||||
token <- get_azure_token("https://graph.microsoft.com/", tenant, app)
|
||||
|
||||
|
||||
gr2 <- ms_graph$new(token=token)
|
||||
expect_is(gr2, "ms_graph")
|
||||
expect_true(is_azure_token(gr2$token))
|
||||
|
|
|
@ -22,7 +22,7 @@ test_that("User/group read functionality works",
|
|||
|
||||
objs <- me$list_object_memberships()
|
||||
expect_true(is.character(objs))
|
||||
|
||||
|
||||
grps1 <- me$list_group_memberships()
|
||||
expect_true(is.character(grps1))
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
context("AAD v2.0")
|
||||
|
||||
tenant <- Sys.getenv("AZ_TEST_TENANT_ID")
|
||||
app <- Sys.getenv("AZ_TEST_NATIVE_APP_ID")
|
||||
|
||||
if(tenant == "" || app == "")
|
||||
skip("AAD v2.0 tests skipped: Microsoft Graph credentials not set")
|
||||
|
||||
if(!interactive())
|
||||
skip("AAD v2.0 tests skipped: must be in interactive session")
|
||||
|
||||
|
||||
test_that("Graph authentication works",
|
||||
{
|
||||
token <- get_azure_token(c("https://graph.microsoft.com/.default", "offline_access"), tenant, app, version=2)
|
||||
|
||||
gr <- ms_graph$new(token=token)
|
||||
expect_is(gr, "ms_graph")
|
||||
expect_true(is_azure_token(gr$token))
|
||||
|
||||
me <- gr$get_user()
|
||||
expect_is(me, "az_user")
|
||||
})
|
Загрузка…
Ссылка в новой задаче