Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tests more robust again #165

Merged
merged 4 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Authors@R: c(
person("Noam", "Ross", role = "ctb"),
person("Jake", "Russ", role = "ctb"),
person("Julia", "Silge", role = "rev",
comment = "Julia Silge reviewed {opencage} (v. 0.1.0) for rOpenSci, see <https://github.com/ropensci/onboarding/issues/36>.")
comment = "Julia Silge reviewed \\{opencage\\} (v. 0.1.0) for rOpenSci, see <https://github.com/ropensci/onboarding/issues/36>.")
)
Description: Geocode with the OpenCage API, either from place name to
longitude and latitude (forward geocoding) or from longitude and
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
## Internals

* {opencage} now uses [{testthat} 3e](https://testthat.r-lib.org/articles/third-edition.html) for unit tests ([#141](https://github.com/ropensci/opencage/issues/141)).
* GitHub action workflows have been updated ([#142](https://github.com/ropensci/opencage/issues/142), [#149](https://github.com/ropensci/opencage/pull/149), [#152](https://github.com/ropensci/opencage/pull/152)), [#164](https://github.com/ropensci/opencage/pull/164)). Styler, document, and rhub workflows have been added ([#153](https://github.com/ropensci/opencage/pull/153), [#164](https://github.com/ropensci/opencage/pull/164)).
* Use [{lintr} version 3.0](https://www.tidyverse.org/blog/2022/07/lintr-3-0-0/) and add "package development" linters ([#144](https://github.com/ropensci/opencage/pull/144)).
* `countrycodes` source and script were moved to `data-raw` ([#146](https://github.com/ropensci/opencage/pull/146)).
* Add CITATION.cff and a corresponding GitHub action ([#148](https://github.com/ropensci/opencage/pull/148)).
* Select expressions inside `oc_forward_df()` and `oc_reverse_df()` now use `"column"` instead of `.data$column`, because the latter is [deprecated as of tidyselect v1.2.0](https://tidyselect.r-lib.org/news/index.html#tidyselect-120) ([#150](https://github.com/ropensci/opencage/pull/150)).
* The opencage code now uses a consistent style (`styler::tidyverse_style()`) and all internal functions are documented ([#153](https://github.com/ropensci/opencage/pull/153)).
* GitHub action workflows have been updated ([#142](https://github.com/ropensci/opencage/issues/142), [#149](https://github.com/ropensci/opencage/pull/149), [#152](https://github.com/ropensci/opencage/pull/152)), [#164](https://github.com/ropensci/opencage/pull/164)).
* Styler, document, and rhub GitHub action workflows have been added ([#153](https://github.com/ropensci/opencage/pull/153), [#164](https://github.com/ropensci/opencage/pull/164)).
* Tests are updated to reflect changes in API responses ([#163](https://github.com/ropensci/opencage/pull/163), [#165](https://github.com/ropensci/opencage/pull/165))

# opencage 0.2.2

Expand Down
2 changes: 1 addition & 1 deletion man/opencage-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/helper-opencage.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ oc_fw3 <- function() {

## reverse -----------------------------------------------------------------

oc_lat1 <- function() c(47.21947, 53.55034, 34.05369)
oc_lng1 <- function() c(-1.54754, 10.000654, -118.242767)
oc_lat1 <- function() c(52.087106, 53.55034, 34.05369)
oc_lng1 <- function() c(4.297312, 10.000654, -118.242767)

oc_rev1 <- function() tibble::tibble(id = 1:3, lat = oc_lat1(), lng = oc_lng1())

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-oc_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ test_that("oc_config updates rate limit of oc_get_limit", {
expect_identical(ratelimitr::get_rates(oc_get_limited)[[1]][["n"]], rps)

# set rate_sec back to default: 1L/sec
withr::local_options(oc_rate_sec = NULL)
oc_config()
expect_identical(ratelimitr::get_rates(oc_get_limited)[[1]][["n"]], 1L)
})
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-oc_reverse.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ test_that("tidyeval works for arguments", {
# language
lang <-
oc_reverse_df(oc_rev2(), lat, lng, language = language, output = "all")
expect_identical(lang$oc_country, c("France", "Allemagne", "アメリカ合衆国"))
expect_identical(lang$oc_country, c("Netherlands", "Allemagne", "アメリカ合衆国"))

# no_annotations
ann <-
Expand Down
Loading