Skip to content

Commit

Permalink
test that pre-existing directory from failed run is overwritten
Browse files Browse the repository at this point in the history
  • Loading branch information
mhpob committed Jun 15, 2024
1 parent 10499b8 commit 4c6e18c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/testthat/test-make_receiver_push_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,24 @@ test_that("update_push_log arg works", {
expect_message("Writing report") |>
expect_message("Done")
})




test_that("Pre-existing directory is overwritten", {
dir.create(
file.path(tempdir(), "otndo_files")
)

make_receiver_push_summary(
qualified = pbsm$qualified,
unqualified = pbsm$unqualified,
deployment = pbsm$deployment,
since = Sys.Date() + 1
) |>
expect_message("Asking OTN GeoServer for project information") |>
expect_message("Writing report") |>
expect_message("Done")

expect_false(dir.exists(file.path(tempdir(), "otndo_files")))
})
18 changes: 18 additions & 0 deletions tests/testthat/test-make_tag_push_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,21 @@ test_that("update_push_log arg works", {
expect_message("Writing report") |>
expect_message("Done")
})



test_that("Pre-existing directory is overwritten", {
dir.create(
file.path(tempdir(), "otndo_files")
)

make_tag_push_summary(
matched = pbsm$matched,
since = Sys.Date() + 1
) |>
expect_message("Asking OTN GeoServer for project information") |>
expect_message("Writing report") |>
expect_message("Done")

expect_false(dir.exists(file.path(tempdir(), "otndo_files")))
})

0 comments on commit 4c6e18c

Please sign in to comment.