Skip to content

Commit

Permalink
Fixed unittest error 🔧
Browse files Browse the repository at this point in the history
This error occurs for tickers that were listed recently, and therefore doesn't have daily data yet. The random sampling of tickers have to change.
  • Loading branch information
serkor1 committed Jul 1, 2024
1 parent 697bbb0 commit fddaeb8
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/testthat/test-CICD.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,24 @@ testthat::test_that(
)
)

# 2) get quote from kraken
testthat::expect_no_condition(
output <- get_quote(
output <- try(
get_quote(
ticker = sample(ticker,size = 1),
source = x,
interval = "1d",
interval = "1h",
futures = FALSE
)
)

testthat::expect_false(
object = inherits(
x = output,
what = "try-error"
),
label = paste(
"Error in", x, "(get_quote)"
)
)

# 2) test wether the
# ohlc is logical
Expand Down Expand Up @@ -113,7 +121,7 @@ testthat::test_that(
output <- get_quote(
ticker = ticker,
source = x,
interval = "1d",
interval = "1h",
futures = TRUE
)
)
Expand Down

0 comments on commit fddaeb8

Please sign in to comment.