This commit is contained in:
yueguoguo 2017-06-15 11:28:31 +08:00
Родитель 1133535b19
Коммит 82e6cd3dc1
1 изменённых файлов: 22 добавлений и 22 удалений

Просмотреть файл

@ -25,9 +25,9 @@ sa_name <- paste0("azuresmr", timestamp)
# run test. # run test.
# get cost by day. # get data consumption by day.
test_that("Get cost by day", { test_that("Get data consumption by day", {
skip_if_missing_config(settingsfile) skip_if_missing_config(settingsfile)
time_end <- paste0(as.Date(Sys.Date()), "00:00:00") time_end <- paste0(as.Date(Sys.Date()), "00:00:00")
@ -38,7 +38,7 @@ test_that("Get cost by day", {
timeEnd=time_end, timeEnd=time_end,
granularity="Daily") granularity="Daily")
expect_type(res, type="list") expect_is(res, class="data.frame")
expect_identical(object=names(res), expected=c("usageStartTime", expect_identical(object=names(res), expected=c("usageStartTime",
"usageEndTime", "usageEndTime",
"meterName", "meterName",
@ -61,17 +61,17 @@ test_that("Get pricing rates", {
offerId=config$OFFER, offerId=config$OFFER,
region=config$REGION) region=config$REGION)
expect_type(res, type="list") expect_is(res, class="data.frame")
expect_identical(object=names(res), expected=c("EffectiveDate", expect_identical(object=names(res), expected=c("effectiveDate",
"IncludedQuantity", "includedQuantity",
"MeterCategory", "meterCategory",
"MeterId", "meterId",
"MeterName", "meterName",
"MeterRegion", "meterRegion",
"MeterStatus", "meterStatus",
"MeterSubCategory", "meterSubCategory",
"Unit", "unit",
"MeterRate")) "meterRate"))
}) })
@ -92,12 +92,12 @@ test_that("Get cost by day", {
offerId=config$OFFER, offerId=config$OFFER,
region=config$REGION) region=config$REGION)
expect_type(res, type="list") expect_is(res, class="data.frame")
expect_identical(object=names(res), expected=c("MeterName", expect_identical(object=names(res), expected=c("meterName",
"MeterCategory", "meterCategory",
"MeterSubCategory", "meterSubCategory",
"totalQuantity", "quantity",
"Unit", "unit",
"MeterRate", "meterRate",
"Cost")) "cost"))
}) })