Skip to content

Commit

Permalink
Add test for magpie object with 2 spatial dim
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoch94 committed Jun 7, 2024
1 parent 56345a3 commit e4c3300
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/testthat/test-05_convertGDP.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,18 @@ test_that("convertGDP magpie object", {
years = c(2001, 2002),
names = c("ssp1", "ssp2"),
fill = 100)
magclass::getSets(gdp_in)[1] <- c("iso3c")
gdp_in2 <- magclass::new.magpie("USA.FRA",
years = c(2001, 2002),
names = c("ssp1", "ssp2"),
fill = 100)
gdp_conv <- convertGDP(gdp_in, "current LCU", "constant 2017 Int$PPP")
gdp_conv2 <- convertGDP(gdp_in2, "current LCU", "constant 2017 Int$PPP")

gdp_conv <- convertGDP(gdp_in, "current LCU", "constant 2017 Int$PPP")

expect_s4_class(gdp_conv, "magpie")
expect_mapequal(magclass::getSets(gdp_in), magclass::getSets(gdp_conv))
expect_s4_class(gdp_conv2, "magpie")
expect_mapequal(magclass::getSets(gdp_in), magclass::getSets(gdp_conv))
expect_mapequal(magclass::getSets(gdp_in2), magclass::getSets(gdp_conv2))
})


Expand Down

0 comments on commit e4c3300

Please sign in to comment.