tests/testthat/test-UnblockWorker.R

test_that("UnblockWorker", {
  skip_if_not(CheckAWSKeys())

  # Block
  BlockWorker("A3LXJ76P1ZZPMC", reasons = "Did not follow instructions")

  # Unblock
  expect_type(UnblockWorker("A3LXJ76P1ZZPMC"), "list")
  expect_type(UnblockWorker(workers = "A3LXJ76P1ZZPMC",
                            reasons = as.factor("redemption")), "list")

  # More reasons than workers, error
  expect_s3_class(try(UnblockWorker(workers = "A3LXJ76P1ZZPMC",
                                reasons = c("x", "y")),
                  TRUE), "try-error")
})

Try the pyMTurkR package in your browser

Any scripts or data that you put into this service are public.

pyMTurkR documentation built on Nov. 25, 2021, 9:07 a.m.