Browse Source

fixed usage and added tests

master
boB Rudis 3 years ago
parent
commit
3f90c75f0b
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 4
      R/usage.R
  2. 9
      tests/testthat/test-packettotal.R

4
R/usage.R

@ -18,9 +18,9 @@ pt_usage <- function(api_key = packettotal_api_key()) {
httr::stop_for_status(res)
out <- httr::content(res, as = "text")
out <- httr::content(res, as = "text", encoding = "UTF-8")
out <- jsonlite::fromJSON(out, encoding = "UTF-8")
out <- jsonlite::fromJSON(out)
out

9
tests/testthat/test-packettotal.R

@ -1,6 +1,9 @@
context("minimal package functionality")
test_that("we can do something", {
#expect_that(some_function(), is_a("data.frame"))
skip_on_cran()
expect_true("user" %in% names(pt_usage()))
x <- pt_info("d210f4dbea97949f694e849507951881")
expect_true("md5" %in% names(x$pcap_metadata))
})

Loading…
Cancel
Save