From 7c19ed3e0a05eba7bb7407cb5813cb12d07ae06f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Sat, 27 Apr 2024 11:49:56 +0200 Subject: [PATCH] Update documentation and few tests --- .Rbuildignore | 3 + DESCRIPTION | 6 +- R/bugRzilla.R | 3 +- R/get_bug.R | 1 + man/bugRzilla.Rd | 13 ++++ tests/fixtures/get_fields.json | 1 + tests/fixtures/get_history.json | 1 + tests/fixtures/get_history_fails.json | 1 + tests/testthat/_snaps/api.md | 16 ++--- tests/testthat/_snaps/api.new.md | 86 --------------------------- tests/testthat/_snaps/get_user.md | 4 +- tests/testthat/helper-vcr.R | 2 +- tests/testthat/test-post_comment.R | 18 +++--- 13 files changed, 45 insertions(+), 110 deletions(-) create mode 100644 tests/fixtures/get_fields.json create mode 100644 tests/fixtures/get_history.json create mode 100644 tests/fixtures/get_history_fails.json delete mode 100644 tests/testthat/_snaps/api.new.md diff --git a/.Rbuildignore b/.Rbuildignore index 2db40db..58893a7 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,6 @@ ^_pkgdown\.yml$ ^docs$ ^pkgdown$ + +r_bugzilla.sql +mysql_rbugs.R diff --git a/DESCRIPTION b/DESCRIPTION index aecaade..cb4e340 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Type: Package Package: bugRzilla -Title: Interact with Bugzilla +Title: Interact with Bugzilla Version: 0.0.90001 Authors@R: person(given = "Lluís", @@ -8,7 +8,7 @@ Authors@R: role = c("aut", "cre", "cph"), email = "lluis.revilla@gmail.com", comment = c(ORCID = "0000-0001-9747-2570")) -Description: Provides data from bugzilla and allows to post. +Description: Uses the Bugzilla API to retrieve bug and allows to post. License: GPL (>= 3) URL: https://github.com/llrs/bugRzilla BugReports: https://github.com/llrs/bugRzilla/issues @@ -30,4 +30,4 @@ VignetteBuilder: Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.1 +RoxygenNote: 7.3.1 diff --git a/R/bugRzilla.R b/R/bugRzilla.R index 6f1164c..4f37e30 100644 --- a/R/bugRzilla.R +++ b/R/bugRzilla.R @@ -14,6 +14,5 @@ #' Consider if this has been reported on the mailing list (R-devel) or on the #' issue tracker itself. #' -#' @docType package #' @name bugRzilla -NULL +"_PACKAGE" diff --git a/R/get_bug.R b/R/get_bug.R index 737661a..48ecdc5 100644 --- a/R/get_bug.R +++ b/R/get_bug.R @@ -15,6 +15,7 @@ get_bug <- function(issue, host) { url <- paste0(host, "rest/bug?id=", issues) bugs <- httr::GET(url, .state$headers) httr::stop_for_status(bugs) + bugs <- httr::content(bugs) if ("error" %in% names(bugs)) { diff --git a/man/bugRzilla.Rd b/man/bugRzilla.Rd index 6b5f6b4..d6fede7 100644 --- a/man/bugRzilla.Rd +++ b/man/bugRzilla.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/bugRzilla.R \docType{package} \name{bugRzilla} +\alias{bugRzilla-package} \alias{bugRzilla} \title{bugRzilla: A package to interact with Bugzilla.} \description{ @@ -22,3 +23,15 @@ Consider if this has been reported on the mailing list (R-devel) or on the issue tracker itself. } +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/llrs/bugRzilla} + \item Report bugs at \url{https://github.com/llrs/bugRzilla/issues} +} + +} +\author{ +\strong{Maintainer}: Lluís Revilla Sancho \email{lluis.revilla@gmail.com} (\href{https://orcid.org/0000-0001-9747-2570}{ORCID}) [copyright holder] + +} diff --git a/tests/fixtures/get_fields.json b/tests/fixtures/get_fields.json new file mode 100644 index 0000000..f4c0120 --- /dev/null +++ b/tests/fixtures/get_fields.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/field/bug","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*"}},"response":{"status":{"status_code":200,"category":"Success","reason":"OK","message":"Success: (200) OK"},"headers":{"server":"nginx","date":"Sat, 27 Apr 2024 09:48:09 GMT","content-type":"application/json; charset=UTF-8","content-length":"24177","etag":"NtCZ/WnWI+y/fqwDmj1EQA","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-password, x-bugzilla-api-key, x-bugzilla-token, x-bugzilla-login","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"fields\":[{\"name\":\"bug_id\",\"is_mandatory\":false,\"is_custom\":false,\"id\":1,\"display_name\":\"Bug #\",\"is_on_bug_entry\":false,\"type\":0,\"visibility_values\":[],\"visibility_field\":null},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Summary\",\"is_custom\":false,\"id\":2,\"is_mandatory\":true,\"name\":\"short_desc\",\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_values\":[],\"visibility_field\":null,\"value_field\":null,\"id\":3,\"values\":[{\"visibility_values\":[],\"sortkey\":0,\"name\":\"Unclassified\",\"sort_key\":0}],\"is_custom\":false,\"name\":\"classification\",\"is_mandatory\":false,\"type\":2,\"is_on_bug_entry\":false,\"display_name\":\"Classification\"},{\"visibility_values\":[],\"visibility_field\":null,\"id\":4,\"is_custom\":false,\"is_mandatory\":true,\"name\":\"product\",\"is_on_bug_entry\":false,\"type\":2,\"display_name\":\"Product\"},{\"is_custom\":false,\"id\":5,\"values\":[{\"is_active\":false,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 2.10.x\"},{\"name\":\"old\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"name\":\"R 2.12.0\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"R 2.x\"},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 2.11.1\",\"sort_key\":0},{\"sort_key\":0,\"name\":\"R-devel (trunk)\",\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false,\"name\":\"R 2.12.1\",\"sort_key\":0},{\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false,\"name\":\"R 2.12.2\",\"sort_key\":0},{\"sort_key\":0,\"name\":\"R 2.13.0\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"R 2.13.1\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 2.13.2\",\"sort_key\":0},{\"name\":\"R 2.14.0\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"name\":\"R 2.14.2\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"name\":\"R 2.15.0\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"sort_key\":0,\"name\":\"R 2.15.x\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"sort_key\":0,\"name\":\"R 2.15.1\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"sort_key\":0,\"name\":\"R 3.0.0\",\"is_active\":false,\"visibility_values\":[\"R\"],\"sortkey\":0},{\"sort_key\":0,\"name\":\"R 3.0.1\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"R 3.0.2\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 3.0.3\",\"sort_key\":0},{\"name\":\"R 3.1.0\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"is_active\":false,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 3.1.1\"},{\"sort_key\":0,\"name\":\"R 3.1.2\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"R 3.1.3\"},{\"sort_key\":0,\"name\":\"R 3.2.0\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 3.2.1\",\"sort_key\":0},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 3.2.2\",\"sort_key\":0},{\"name\":\"R 3.2.3\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false,\"name\":\"R 3.2.4\",\"sort_key\":0},{\"name\":\"R 3.2.4 revised\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"R 3.3.*\"},{\"name\":\"R 3.4.0\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 3.4.1\",\"sort_key\":0},{\"name\":\"R 3.4.3\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"name\":\"R 2.y.z\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"R 3.4.4\"},{\"sort_key\":0,\"name\":\"R 3.5.0\",\"is_active\":false,\"visibility_values\":[\"R\"],\"sortkey\":0},{\"sort_key\":0,\"name\":\"R 3.5.1\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"R 3.5.2\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"sort_key\":0,\"name\":\"R 3.5.3\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"R 3.6.xx\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"is_active\":false,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 4.0.0\"},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 4.0.x\",\"sort_key\":0},{\"name\":\"R 4.1.0\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"R 4.1.x\"},{\"sortkey\":0,\"visibility_values\":[\"Rtools\"],\"is_active\":true,\"name\":\"4.2\",\"sort_key\":0},{\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 4.2.x\"},{\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 4.3.x\"},{\"sort_key\":0,\"name\":\"4.3\",\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"Rtools\"]},{\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 4.4.x\"}],\"name\":\"version\",\"is_mandatory\":true,\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Version\",\"visibility_values\":[],\"value_field\":\"product\",\"visibility_field\":null},{\"is_mandatory\":false,\"name\":\"rep_platform\",\"id\":6,\"is_on_bug_entry\":false,\"type\":2,\"visibility_values\":[],\"is_custom\":false,\"values\":[{\"sort_key\":100,\"name\":\"All\",\"visibility_values\":[],\"sortkey\":100},{\"sort_key\":250,\"name\":\"x86_64/x64/amd64 (64-bit)\",\"sortkey\":250,\"visibility_values\":[]},{\"sortkey\":260,\"visibility_values\":[],\"sort_key\":260,\"name\":\"arm64/M1\"},{\"sort_key\":280,\"name\":\"ix86 (32-bit)\",\"visibility_values\":[],\"sortkey\":280},{\"name\":\"PowerPC\",\"sort_key\":300,\"sortkey\":300,\"visibility_values\":[]},{\"visibility_values\":[],\"sortkey\":350,\"sort_key\":350,\"name\":\"Sparc\"},{\"name\":\"SGI\",\"sort_key\":360,\"sortkey\":360,\"visibility_values\":[]},{\"name\":\"Other\",\"sort_key\":400,\"visibility_values\":[],\"sortkey\":400}],\"display_name\":\"Platform\",\"value_field\":null,\"visibility_field\":null},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"bug_file_loc\",\"id\":7,\"is_custom\":false,\"display_name\":\"URL\",\"type\":0,\"is_on_bug_entry\":false},{\"display_name\":\"OS/Version\",\"values\":[{\"sortkey\":100,\"visibility_values\":[],\"sort_key\":100,\"name\":\"All\"},{\"visibility_values\":[],\"sortkey\":200,\"sort_key\":200,\"name\":\"Windows 32-bit\"},{\"name\":\"Windows 64-bit\",\"sort_key\":210,\"sortkey\":210,\"visibility_values\":[]},{\"sortkey\":308,\"visibility_values\":[],\"name\":\"Mac OS X v10.4\",\"sort_key\":308},{\"sort_key\":309,\"name\":\"Mac OS X v10.5\",\"sortkey\":309,\"visibility_values\":[]},{\"sort_key\":310,\"name\":\"Mac OS X v10.6\",\"visibility_values\":[],\"sortkey\":310},{\"sort_key\":311,\"name\":\"Mac OS X v10.7\",\"sortkey\":311,\"visibility_values\":[]},{\"name\":\"Mac OS X v10.8\",\"sort_key\":312,\"visibility_values\":[],\"sortkey\":312},{\"sortkey\":313,\"visibility_values\":[],\"name\":\"OS X Mavericks\",\"sort_key\":313},{\"sort_key\":314,\"name\":\"OS X Yosemite\",\"visibility_values\":[],\"sortkey\":314},{\"sortkey\":315,\"visibility_values\":[],\"name\":\"OS X El Capitan\",\"sort_key\":315},{\"sortkey\":340,\"visibility_values\":[],\"sort_key\":340,\"name\":\"macOS\"},{\"visibility_values\":[],\"sortkey\":400,\"sort_key\":400,\"name\":\"Linux\"},{\"name\":\"Linux-Debian\",\"sort_key\":405,\"sortkey\":405,\"visibility_values\":[]},{\"sortkey\":407,\"visibility_values\":[],\"sort_key\":407,\"name\":\"Linux-Ubuntu\"},{\"name\":\"Linux-Fedora\",\"sort_key\":410,\"sortkey\":410,\"visibility_values\":[]},{\"visibility_values\":[],\"sortkey\":411,\"name\":\"Linux-RHEL\",\"sort_key\":411},{\"sortkey\":420,\"visibility_values\":[],\"name\":\"Linux-Gentoo\",\"sort_key\":420},{\"sort_key\":430,\"name\":\"FreeBSD\",\"sortkey\":430,\"visibility_values\":[]},{\"name\":\"Solaris\",\"sort_key\":450,\"sortkey\":450,\"visibility_values\":[]},{\"sort_key\":470,\"name\":\"IRIX\",\"sortkey\":470,\"visibility_values\":[]},{\"name\":\"AIX\",\"sort_key\":475,\"visibility_values\":[],\"sortkey\":475},{\"visibility_values\":[],\"sortkey\":480,\"sort_key\":480,\"name\":\"unix-other\"},{\"sort_key\":500,\"name\":\"Other\",\"sortkey\":500,\"visibility_values\":[]}],\"is_custom\":false,\"visibility_field\":null,\"value_field\":null,\"type\":2,\"is_on_bug_entry\":false,\"name\":\"op_sys\",\"is_mandatory\":false,\"id\":8,\"visibility_values\":[]},{\"name\":\"bug_status\",\"is_mandatory\":false,\"values\":[{\"sort_key\":0,\"name\":null,\"is_open\":true,\"sortkey\":0,\"visibility_values\":[],\"can_change_to\":[{\"name\":\"UNCONFIRMED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"NEW\"}]},{\"is_open\":true,\"sortkey\":100,\"visibility_values\":[],\"can_change_to\":[{\"name\":\"CONFIRMED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"ASSIGNED\"},{\"name\":\"CLOSED\",\"comment_required\":false}],\"name\":\"UNCONFIRMED\",\"sort_key\":100},{\"visibility_values\":[],\"sortkey\":200,\"is_open\":true,\"can_change_to\":[{\"name\":\"UNCONFIRMED\",\"comment_required\":false},{\"name\":\"CONFIRMED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"ASSIGNED\"},{\"comment_required\":false,\"name\":\"CLOSED\"}],\"sort_key\":200,\"name\":\"NEW\"},{\"can_change_to\":[{\"name\":\"ASSIGNED\",\"comment_required\":false},{\"name\":\"CLOSED\",\"comment_required\":false}],\"is_open\":true,\"sortkey\":201,\"visibility_values\":[],\"name\":\"CONFIRMED\",\"sort_key\":201},{\"visibility_values\":[],\"sortkey\":300,\"is_open\":true,\"can_change_to\":[{\"name\":\"UNCONFIRMED\",\"comment_required\":false},{\"name\":\"CLOSED\",\"comment_required\":false}],\"sort_key\":300,\"name\":\"ASSIGNED\"},{\"is_open\":true,\"sortkey\":400,\"visibility_values\":[],\"can_change_to\":[{\"comment_required\":false,\"name\":\"UNCONFIRMED\"},{\"comment_required\":false,\"name\":\"CONFIRMED\"},{\"name\":\"ASSIGNED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"CLOSED\"}],\"sort_key\":400,\"name\":\"REOPENED\"},{\"sort_key\":500,\"name\":\"RESOLVED\",\"can_change_to\":[{\"name\":\"UNCONFIRMED\",\"comment_required\":false},{\"name\":\"REOPENED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"VERIFIED\"},{\"name\":\"CLOSED\",\"comment_required\":false}],\"is_open\":false,\"visibility_values\":[],\"sortkey\":500},{\"is_open\":false,\"visibility_values\":[],\"sortkey\":600,\"can_change_to\":[{\"name\":\"UNCONFIRMED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"REOPENED\"},{\"comment_required\":false,\"name\":\"CLOSED\"}],\"name\":\"VERIFIED\",\"sort_key\":600},{\"sort_key\":700,\"name\":\"CLOSED\",\"visibility_values\":[],\"sortkey\":700,\"is_open\":false,\"can_change_to\":[{\"name\":\"REOPENED\",\"comment_required\":false},{\"name\":\"VERIFIED\",\"comment_required\":false}]}],\"id\":9,\"is_custom\":false,\"display_name\":\"Status\",\"type\":2,\"is_on_bug_entry\":false,\"visibility_values\":[],\"visibility_field\":null,\"value_field\":null},{\"is_mandatory\":false,\"name\":\"status_whiteboard\",\"id\":10,\"is_custom\":false,\"display_name\":\"Status Whiteboard\",\"type\":0,\"is_on_bug_entry\":false,\"visibility_values\":[],\"visibility_field\":null},{\"visibility_values\":[],\"visibility_field\":null,\"value_field\":null,\"is_mandatory\":false,\"name\":\"keywords\",\"id\":11,\"values\":[{\"description\":\"A well tested patch would help resolve this bug.\",\"name\":\"HELPWANTED\"}],\"is_custom\":false,\"display_name\":\"Keywords\",\"type\":8,\"is_on_bug_entry\":false},{\"value_field\":null,\"visibility_field\":null,\"display_name\":\"Resolution\",\"is_custom\":false,\"values\":[{\"name\":\"\",\"sort_key\":100,\"sortkey\":100,\"visibility_values\":[]},{\"sortkey\":200,\"visibility_values\":[],\"sort_key\":200,\"name\":\"FIXED\"},{\"sortkey\":300,\"visibility_values\":[],\"name\":\"INVALID\",\"sort_key\":300},{\"sort_key\":350,\"name\":\"NOT REPRODUCIBLE\",\"sortkey\":350,\"visibility_values\":[]},{\"visibility_values\":[],\"sortkey\":370,\"name\":\"SPAM\",\"sort_key\":370},{\"sort_key\":400,\"name\":\"WONTFIX\",\"visibility_values\":[],\"sortkey\":400},{\"sortkey\":425,\"visibility_values\":[],\"sort_key\":425,\"name\":\"Works as documented\"},{\"visibility_values\":[],\"sortkey\":450,\"sort_key\":450,\"name\":\"WISHLIST\"},{\"visibility_values\":[],\"sortkey\":500,\"name\":\"DUPLICATE\",\"sort_key\":500},{\"name\":\"WORKSFORME\",\"sort_key\":600,\"sortkey\":600,\"visibility_values\":[]},{\"sort_key\":650,\"name\":\"CONTRIBUTED PACKAGE\",\"visibility_values\":[],\"sortkey\":650},{\"sortkey\":700,\"visibility_values\":[],\"sort_key\":700,\"name\":\"MOVED\"}],\"visibility_values\":[],\"type\":2,\"is_on_bug_entry\":false,\"id\":12,\"is_mandatory\":false,\"name\":\"resolution\"},{\"visibility_values\":[],\"visibility_field\":null,\"value_field\":null,\"id\":13,\"values\":[{\"sort_key\":100,\"name\":\"blocker\",\"sortkey\":100,\"visibility_values\":[]},{\"sortkey\":200,\"visibility_values\":[],\"sort_key\":200,\"name\":\"critical\"},{\"visibility_values\":[],\"sortkey\":300,\"name\":\"major\",\"sort_key\":300},{\"visibility_values\":[],\"sortkey\":400,\"name\":\"normal\",\"sort_key\":400},{\"visibility_values\":[],\"sortkey\":500,\"sort_key\":500,\"name\":\"minor\"},{\"sort_key\":600,\"name\":\"trivial\",\"sortkey\":600,\"visibility_values\":[]},{\"visibility_values\":[],\"sortkey\":700,\"name\":\"enhancement\",\"sort_key\":700}],\"is_custom\":false,\"is_mandatory\":false,\"name\":\"bug_severity\",\"type\":2,\"is_on_bug_entry\":false,\"display_name\":\"Severity\"},{\"name\":\"priority\",\"is_mandatory\":false,\"id\":14,\"values\":[{\"name\":\"P1\",\"sort_key\":100,\"visibility_values\":[],\"sortkey\":100},{\"sort_key\":200,\"name\":\"P2\",\"sortkey\":200,\"visibility_values\":[]},{\"name\":\"P3\",\"sort_key\":300,\"sortkey\":300,\"visibility_values\":[]},{\"visibility_values\":[],\"sortkey\":400,\"sort_key\":400,\"name\":\"P4\"},{\"name\":\"P5\",\"sort_key\":500,\"visibility_values\":[],\"sortkey\":500}],\"is_custom\":false,\"display_name\":\"Priority\",\"is_on_bug_entry\":false,\"type\":2,\"visibility_values\":[],\"visibility_field\":null,\"value_field\":null},{\"is_mandatory\":true,\"name\":\"component\",\"is_custom\":false,\"id\":15,\"values\":[{\"sort_key\":0,\"name\":\"Accuracy\",\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"Add-ons\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"sort_key\":0,\"name\":\"Analyses\",\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0},{\"name\":\"Documentation\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"sort_key\":0,\"name\":\"Graphics\",\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0},{\"sort_key\":0,\"name\":\"I/O\",\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"Installation\"},{\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true,\"name\":\"Language\",\"sort_key\":0},{\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"Low-level\"},{\"sort_key\":0,\"name\":\"Mac GUI / Mac specific\",\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"Misc\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"sort_key\":0,\"name\":\"Models\",\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0},{\"name\":\"S4methods\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":true},{\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"Startup\"},{\"name\":\"System-specific\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"Translations\"},{\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"Windows GUI / Window specific\"},{\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true,\"name\":\"Wishlist\",\"sort_key\":0},{\"sortkey\":0,\"visibility_values\":[\"Rtools\"],\"is_active\":true,\"name\":\"Installer\",\"sort_key\":0},{\"sortkey\":0,\"visibility_values\":[\"Rtools\"],\"is_active\":true,\"name\":\"Toolchain and libraries\",\"sort_key\":0}],\"display_name\":\"Component\",\"is_on_bug_entry\":false,\"type\":2,\"visibility_values\":[],\"value_field\":\"product\",\"visibility_field\":null},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"assigned_to\",\"is_custom\":false,\"id\":16,\"display_name\":\"AssignedTo\",\"is_on_bug_entry\":false,\"type\":0},{\"display_name\":\"ReportedBy\",\"is_on_bug_entry\":false,\"type\":0,\"name\":\"reporter\",\"is_mandatory\":false,\"is_custom\":false,\"id\":17,\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_field\":null,\"visibility_values\":[],\"display_name\":\"Votes\",\"type\":0,\"is_on_bug_entry\":false,\"name\":\"votes\",\"is_mandatory\":false,\"is_custom\":false,\"id\":18},{\"visibility_field\":null,\"visibility_values\":[],\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"QAContact\",\"is_custom\":false,\"id\":19,\"is_mandatory\":false,\"name\":\"qa_contact\"},{\"visibility_field\":null,\"visibility_values\":[],\"display_name\":\"CC\",\"type\":0,\"is_on_bug_entry\":false,\"name\":\"cc\",\"is_mandatory\":false,\"id\":20,\"is_custom\":false},{\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Depends on\",\"is_custom\":false,\"id\":21,\"name\":\"dependson\",\"is_mandatory\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"id\":22,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"blocked\",\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Blocks\",\"visibility_values\":[],\"visibility_field\":null},{\"is_custom\":false,\"id\":23,\"name\":\"attachments.description\",\"is_mandatory\":false,\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Attachment description\",\"visibility_values\":[],\"visibility_field\":null},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Attachment filename\",\"id\":24,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"attachments.filename\",\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"attachments.mimetype\",\"is_custom\":false,\"id\":25,\"display_name\":\"Attachment mime type\",\"type\":0,\"is_on_bug_entry\":false},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"attachments.ispatch\",\"id\":26,\"is_custom\":false,\"display_name\":\"Attachment is patch\",\"is_on_bug_entry\":false,\"type\":0},{\"visibility_values\":[],\"visibility_field\":null,\"is_custom\":false,\"id\":27,\"is_mandatory\":false,\"name\":\"attachments.isobsolete\",\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Attachment is obsolete\"},{\"visibility_values\":[],\"visibility_field\":null,\"name\":\"attachments.isprivate\",\"is_mandatory\":false,\"is_custom\":false,\"id\":28,\"display_name\":\"Attachment is private\",\"is_on_bug_entry\":false,\"type\":0},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Attachment creator\",\"id\":29,\"is_custom\":false,\"name\":\"attachments.submitter\",\"is_mandatory\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"type\":0,\"is_on_bug_entry\":false,\"is_mandatory\":false,\"name\":\"target_milestone\",\"id\":30,\"visibility_values\":[],\"display_name\":\"Target Milestone\",\"values\":[{\"name\":\"---\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"name\":\"---\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"Rtools\"],\"is_active\":true}],\"is_custom\":false,\"visibility_field\":null,\"value_field\":\"product\"},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Creation date\",\"id\":31,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"creation_ts\",\"visibility_field\":null,\"visibility_values\":[]},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Last changed date\",\"id\":32,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"delta_ts\",\"visibility_field\":null,\"visibility_values\":[]},{\"id\":33,\"is_custom\":false,\"name\":\"longdesc\",\"is_mandatory\":false,\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Comment\",\"visibility_values\":[],\"visibility_field\":null},{\"visibility_field\":null,\"visibility_values\":[],\"display_name\":\"Comment is private\",\"is_on_bug_entry\":false,\"type\":0,\"name\":\"longdescs.isprivate\",\"is_mandatory\":false,\"is_custom\":false,\"id\":34},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Alias\",\"id\":35,\"is_custom\":false,\"name\":\"alias\",\"is_mandatory\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"everconfirmed\",\"id\":36,\"is_custom\":false,\"display_name\":\"Ever Confirmed\",\"is_on_bug_entry\":false,\"type\":0},{\"visibility_values\":[],\"visibility_field\":null,\"is_custom\":false,\"id\":37,\"name\":\"reporter_accessible\",\"is_mandatory\":false,\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Reporter Accessible\"},{\"id\":38,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"cclist_accessible\",\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"CC Accessible\",\"visibility_values\":[],\"visibility_field\":null},{\"visibility_values\":[],\"visibility_field\":null,\"id\":39,\"is_custom\":false,\"name\":\"bug_group\",\"is_mandatory\":false,\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Group\"},{\"is_custom\":false,\"id\":40,\"is_mandatory\":false,\"name\":\"estimated_time\",\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Estimated Hours\",\"visibility_values\":[],\"visibility_field\":null},{\"display_name\":\"Remaining Hours\",\"is_on_bug_entry\":false,\"type\":0,\"is_mandatory\":false,\"name\":\"remaining_time\",\"id\":41,\"is_custom\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"display_name\":\"Deadline\",\"type\":5,\"is_on_bug_entry\":false,\"name\":\"deadline\",\"is_mandatory\":false,\"is_custom\":false,\"id\":42,\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_field\":null,\"visibility_values\":[],\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Commenter\",\"id\":43,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"commenter\"},{\"display_name\":\"Flags\",\"type\":0,\"is_on_bug_entry\":false,\"name\":\"flagtypes.name\",\"is_mandatory\":false,\"id\":44,\"is_custom\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_field\":null,\"visibility_values\":[],\"display_name\":\"Flag Requestee\",\"is_on_bug_entry\":false,\"type\":0,\"is_mandatory\":false,\"name\":\"requestees.login_name\",\"is_custom\":false,\"id\":45},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Flag Setter\",\"is_custom\":false,\"id\":46,\"is_mandatory\":false,\"name\":\"setters.login_name\",\"visibility_field\":null,\"visibility_values\":[]},{\"display_name\":\"Hours Worked\",\"is_on_bug_entry\":false,\"type\":0,\"name\":\"work_time\",\"is_mandatory\":false,\"is_custom\":false,\"id\":47,\"visibility_field\":null,\"visibility_values\":[]},{\"is_mandatory\":false,\"name\":\"percentage_complete\",\"is_custom\":false,\"id\":48,\"display_name\":\"Percentage Complete\",\"is_on_bug_entry\":false,\"type\":0,\"visibility_values\":[],\"visibility_field\":null},{\"is_custom\":false,\"id\":49,\"name\":\"content\",\"is_mandatory\":false,\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Content\",\"visibility_values\":[],\"visibility_field\":null},{\"visibility_values\":[],\"visibility_field\":null,\"name\":\"attach_data.thedata\",\"is_mandatory\":false,\"is_custom\":false,\"id\":50,\"display_name\":\"Attachment data\",\"is_on_bug_entry\":false,\"type\":0},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"owner_idle_time\",\"id\":52,\"is_custom\":false,\"display_name\":\"Time Since Assignee Touched\",\"type\":0,\"is_on_bug_entry\":false},{\"visibility_values\":[],\"visibility_field\":null,\"id\":53,\"is_custom\":false,\"name\":\"days_elapsed\",\"is_mandatory\":false,\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Days since bug changed\"},{\"visibility_field\":null,\"visibility_values\":[],\"is_on_bug_entry\":false,\"type\":7,\"display_name\":\"See Also\",\"id\":54,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"see_also\"},{\"visibility_values\":[],\"visibility_field\":null,\"id\":55,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"longdescs.count\",\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Number of Comments\"},{\"visibility_values\":[],\"visibility_field\":null,\"name\":\"tag\",\"is_mandatory\":false,\"is_custom\":false,\"id\":56,\"display_name\":\"Personal Tags\",\"type\":8,\"is_on_bug_entry\":false},{\"visibility_values\":[],\"visibility_field\":null,\"is_custom\":false,\"id\":57,\"name\":\"assigned_to_realname\",\"is_mandatory\":false,\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"AssignedToName\"},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"reporter_realname\",\"is_custom\":false,\"id\":58,\"display_name\":\"ReportedByName\",\"type\":0,\"is_on_bug_entry\":false},{\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"QAContactName\",\"id\":59,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"qa_contact_realname\",\"visibility_field\":null,\"visibility_values\":[]},{\"display_name\":\"Last Visit\",\"is_on_bug_entry\":false,\"type\":5,\"is_mandatory\":false,\"name\":\"last_visit_ts\",\"id\":60,\"is_custom\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_field\":null,\"visibility_values\":[],\"display_name\":\"Comment Tag\",\"is_on_bug_entry\":false,\"type\":0,\"is_mandatory\":false,\"name\":\"comment_tag\",\"is_custom\":false,\"id\":61},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Duplicate of\",\"is_custom\":false,\"id\":62,\"name\":\"dupe_of\",\"is_mandatory\":false,\"visibility_field\":null,\"visibility_values\":[]}]}"}},"recorded_at":"2024-04-27 09:48:09 GMT","recorded_with":"vcr/1.2.2, webmockr/0.9.0"}]} diff --git a/tests/fixtures/get_history.json b/tests/fixtures/get_history.json new file mode 100644 index 0000000..188fc4f --- /dev/null +++ b/tests/fixtures/get_history.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug/1/history","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Sat, 27 Apr 2024 09:48:09 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-password, x-bugzilla-api-key, x-bugzilla-login, x-bugzilla-token","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"code\":\"306\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"error\":true}"}},"recorded_at":"2024-04-27 09:48:09 GMT","recorded_with":"vcr/1.2.2, webmockr/0.9.0"}]} diff --git a/tests/fixtures/get_history_fails.json b/tests/fixtures/get_history_fails.json new file mode 100644 index 0000000..9a17376 --- /dev/null +++ b/tests/fixtures/get_history_fails.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug/2/history","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Sat, 27 Apr 2024 09:48:10 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-login, x-bugzilla-token, x-bugzilla-api-key, x-bugzilla-password","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"code\":\"306\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"error\":true}"}},"recorded_at":"2024-04-27 09:48:10 GMT","recorded_with":"vcr/1.2.2, webmockr/0.9.0"}]} diff --git a/tests/testthat/_snaps/api.md b/tests/testthat/_snaps/api.md index 1a94542..ac8f063 100644 --- a/tests/testthat/_snaps/api.md +++ b/tests/testthat/_snaps/api.md @@ -2,33 +2,33 @@ Code create_bugzilla_key() - Message + Message i Reading cached keys on '~/.cache/R/bugRzilla/.Renviron'. v Found key `R_BUGZILLA`. v Using key `R_BUGZILLA`. - v Authenticated on this site! + x Not authenticated on this site. # create_bugzilla_key() works [unicode] Code create_bugzilla_key() - Message + Message ℹ Reading cached keys on '~/.cache/R/bugRzilla/.Renviron'. ✔ Found key `R_BUGZILLA`. ✔ Using key `R_BUGZILLA`. - ✔ Authenticated on this site! + ✖ Not authenticated on this site. # set_key works Code sk <- set_key() - Message + Message i Reading cached keys on '~/.cache/R/bugRzilla/.Renviron'. v Found key `R_BUGZILLA`. v Using key `R_BUGZILLA`. Code expect_equal(write_renviron(key = sk, value = sk, file = app_file()), NULL) - Message + Message v Storing key on '~/.cache/R/bugRzilla/.Renviron'. # check_key() works [plain] @@ -49,14 +49,14 @@ Code use_key(missing_key()) - Message + Message v Using key `R_BUGZILLA`. # use_key() works [unicode] Code use_key(missing_key()) - Message + Message ✔ Using key `R_BUGZILLA`. # valid_key() works [plain] diff --git a/tests/testthat/_snaps/api.new.md b/tests/testthat/_snaps/api.new.md deleted file mode 100644 index 50a3950..0000000 --- a/tests/testthat/_snaps/api.new.md +++ /dev/null @@ -1,86 +0,0 @@ -# create_bugzilla_key() works [plain] - - Code - create_bugzilla_key() - Message - v Found key `R_BUGZILLA`. - v Using key `R_BUGZILLA`. - x Not authenticated on this site. - -# create_bugzilla_key() works [unicode] - - Code - create_bugzilla_key() - Message - ✔ Found key `R_BUGZILLA`. - ✔ Using key `R_BUGZILLA`. - ✖ Not authenticated on this site. - -# set_key works - - Code - sk <- set_key() - Message - v Found key `R_BUGZILLA`. - v Using key `R_BUGZILLA`. - Code - expect_equal(write_renviron(key = sk, value = sk, file = app_file()), NULL) - Message - v Storing key on '~/.cache/R/bugRzilla/.Renviron'. - -# check_key() works [plain] - - Code - check_key(key_name = missing_key(), verbose = FALSE) - Output - [1] TRUE - -# check_key() works [unicode] - - Code - check_key(key_name = missing_key(), verbose = FALSE) - Output - [1] TRUE - -# use_key() works [plain] - - Code - use_key(missing_key()) - Message - v Using key `R_BUGZILLA`. - -# use_key() works [unicode] - - Code - use_key(missing_key()) - Message - ✔ Using key `R_BUGZILLA`. - -# valid_key() works [plain] - - Code - valid_key(key = "hgfcchg12") - Output - [1] TRUE - -# valid_key() works [ansi] - - Code - valid_key(key = "hgfcchg12") - Output - [1] TRUE - -# valid_key() works [unicode] - - Code - valid_key(key = "hgfcchg12") - Output - [1] TRUE - -# valid_key() works [fancy] - - Code - valid_key(key = "hgfcchg12") - Output - [1] TRUE - diff --git a/tests/testthat/_snaps/get_user.md b/tests/testthat/_snaps/get_user.md index 8b079b2..c13dcc6 100644 --- a/tests/testthat/_snaps/get_user.md +++ b/tests/testthat/_snaps/get_user.md @@ -2,13 +2,13 @@ Code use_key() - Message + Message v Using key `R_BUGZILLA`. # get_user multiple ids Code use_key() - Message + Message v Using key `R_BUGZILLA`. diff --git a/tests/testthat/helper-vcr.R b/tests/testthat/helper-vcr.R index 59bddcf..c6ff449 100644 --- a/tests/testthat/helper-vcr.R +++ b/tests/testthat/helper-vcr.R @@ -10,7 +10,7 @@ if (!nzchar(Sys.getenv("R_BUGZILLA"))) { } } -use_key() +use_key("R_BUGZILLA") invisible(vcr::vcr_configure( dir = vcr_dir, diff --git a/tests/testthat/test-post_comment.R b/tests/testthat/test-post_comment.R index c6959f5..e0ef7d4 100644 --- a/tests/testthat/test-post_comment.R +++ b/tests/testthat/test-post_comment.R @@ -1,9 +1,11 @@ -test_that("post_comment works", { - vcr::use_cassette("post_comment", { - pc <- post_comment(issue = 1, comment = "testing", - host = "https://rbugs-devel.urbanek.info/", - key = "R_DEV_BUGZILLA") - }) - expect_true(is.numeric(pc)) -}) +# Website is no longer available +# test_that("post_comment works", { +# vcr::use_cassette("post_comment", { +# pc <- post_comment(issue = 1, comment = "testing", +# host = "https://rbugs-devel.urbanek.info/", +# key = "R_DEV_BUGZILLA") +# }) +# expect_true(is.numeric(pc)) +# +# })