Skip to content

Commit

Permalink
Fix Broken Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenMMortimer committed Mar 29, 2018
1 parent f9f1d90 commit a14f04e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions tests/testthat/test-CustomFieldService.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ myuuid <- paste(
)

options(rdfp.network_code = rdfp_options$test_network_code)
request_data <- data.frame(name=paste0('Shift - ', myuuid),
description='The shift that this user usually works.',
entityType='USER',
request_data <- data.frame(name=paste0('Timing - ', myuuid),
description='The time of that this creative usually runs.',
entityType='CREATIVE',
dataType='DROP_DOWN',
visibility='FULL')
dfp_createCustomFields_result <- dfp_createCustomFields(request_data)
Expand Down Expand Up @@ -62,7 +62,7 @@ test_that("dfp_getCustomFieldOption", {
test_that("dfp_getCustomFieldsByStatement", {

options(rdfp.network_code = rdfp_options$test_network_code)
request_data <- list('filterStatement'=list('query'=paste0("WHERE name='Shift - ", myuuid, "'")))
request_data <- list('filterStatement'=list('query'=paste0("WHERE name='Timing - ", myuuid, "'")))

dfp_getCustomFieldsByStatement_result <- dfp_getCustomFieldsByStatement(request_data)

Expand All @@ -89,9 +89,9 @@ test_that("dfp_updateCustomFields", {

options(rdfp.network_code = rdfp_options$test_network_code)
request_data <- data.frame(id=dfp_createCustomFields_result$id,
name=paste0('Shift - ', myuuid, '2'),
description='The shift that this user usually works.',
entityType='USER',
name=paste0('Timing - ', myuuid, '2'),
description='The time of that this creative usually runs.',
entityType='CREATIVE',
dataType='DROP_DOWN',
visibility='FULL')
dfp_updateCustomFields_result <- dfp_updateCustomFields(request_data)
Expand All @@ -103,10 +103,9 @@ test_that("dfp_performCustomFieldAction", {

options(rdfp.network_code = rdfp_options$test_network_code)
request_data <- list(customFieldAction='DeactivateCustomFields',
filterStatement=list('query'=paste0("WHERE name = 'Shift - ", myuuid, "2'")))
filterStatement=list('query'=paste0("WHERE name = 'Timing - ", myuuid, "2'")))

dfp_performCustomFieldAction_result <- dfp_performCustomFieldAction(request_data)

expect_is(dfp_performCustomFieldAction_result, "data.frame")
expect_true(all(c('numChanges') %in% names(dfp_performCustomFieldAction_result)))
expect_equal(dfp_performCustomFieldAction_result$numChanges, 1)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-PublisherQueryLanguageService.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test_that("dfp_select", {
dfp_select_result <- dfp_select(request_data, as_df=FALSE)
expect_is(dfp_select_result, "list")

final_result <- dfp_select_parse(dfp_select_result[[1]])
final_result <- dfp_select_parse(dfp_select_result)
expect_is(final_result, "tbl_df")
expect_named(final_result, c('id', 'lineitemtype', 'status'))
})
Expand Down

0 comments on commit a14f04e

Please sign in to comment.