tests/testthat/test-gs-object.R

test_that("can delete objects", {
  skip_if_no_auth()
  tb <- bq_table(bq_test_project(), "basedata", "mtcars")

  gs <- gs_test_object()
  expect_false(gs_object_exists(gs))

  bq_table_save(tb, gs)
  expect_true(gs_object_exists(gs))

  gs_object_delete(gs)
  expect_false(gs_object_exists(gs))
})

test_that("has useful print method", {
  expect_snapshot({
    gs_object("xxx", "yyy")
  })
})

test_that("coercing to character gives URI", {
  gs <- gs_object("xxx", "yyy")
  expect_equal(as.character(gs), "gs://xxx/yyy")
})

Try the bigrquery package in your browser

Any scripts or data that you put into this service are public.

bigrquery documentation built on April 20, 2023, 5:14 p.m.