Skip to content

Commit 4c6e18c

Browse files
committed
test that pre-existing directory from failed run is overwritten
1 parent 10499b8 commit 4c6e18c

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

tests/testthat/test-make_receiver_push_summary.R

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,24 @@ test_that("update_push_log arg works", {
114114
expect_message("Writing report") |>
115115
expect_message("Done")
116116
})
117+
118+
119+
120+
121+
test_that("Pre-existing directory is overwritten", {
122+
dir.create(
123+
file.path(tempdir(), "otndo_files")
124+
)
125+
126+
make_receiver_push_summary(
127+
qualified = pbsm$qualified,
128+
unqualified = pbsm$unqualified,
129+
deployment = pbsm$deployment,
130+
since = Sys.Date() + 1
131+
) |>
132+
expect_message("Asking OTN GeoServer for project information") |>
133+
expect_message("Writing report") |>
134+
expect_message("Done")
135+
136+
expect_false(dir.exists(file.path(tempdir(), "otndo_files")))
137+
})

tests/testthat/test-make_tag_push_summary.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,21 @@ test_that("update_push_log arg works", {
101101
expect_message("Writing report") |>
102102
expect_message("Done")
103103
})
104+
105+
106+
107+
test_that("Pre-existing directory is overwritten", {
108+
dir.create(
109+
file.path(tempdir(), "otndo_files")
110+
)
111+
112+
make_tag_push_summary(
113+
matched = pbsm$matched,
114+
since = Sys.Date() + 1
115+
) |>
116+
expect_message("Asking OTN GeoServer for project information") |>
117+
expect_message("Writing report") |>
118+
expect_message("Done")
119+
120+
expect_false(dir.exists(file.path(tempdir(), "otndo_files")))
121+
})

0 commit comments

Comments
 (0)