Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapereirabr committed Sep 22, 2024
1 parent bcf6279 commit 8adcf5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions R/utils_airfares.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
#'}}
get_airfares_dates_available <- function(dom) {

# message("Function read_airfares() is temporarily unavailable. See issue #30 https://github.com/ipeaGIT/flightsbr/issues/30")
# return(NULL)
#
# stop()

if( ! is.logical(dom) ){ stop(paste0("Argument 'dom' must be either 'TRUE' or 'FALSE.")) }

# read html table
if( isTRUE(dom) ) { base_url = 'https://sas.anac.gov.br/sas/tarifadomestica/' }
if( isFALSE(dom)) { base_url = 'https://sas.anac.gov.br/sas/tarifainternacional/' }
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test_read_airfares.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ test_that("read_airfares", {
testthat::expect_true(is(test6, "data.table"))

# test vector of dates
test7 <- read_airfares(date = c(202001, 202005), showProgress = FALSE)
test7 <- read_airfares(date = c(202201, 202205), showProgress = FALSE)
testthat::expect_true(is(test7, "data.table"))

test8 <- read_airfares(date = c(2021, 2020), showProgress = FALSE)
test8 <- read_airfares(date = c(2020, 2022), showProgress = FALSE)
testthat::expect_true(is(test8, "data.table"))

})
Expand Down

0 comments on commit 8adcf5b

Please sign in to comment.