Skip to content
Snippets Groups Projects
Verified Commit 4a34ffb9 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

TEST: Applying dump upgrade script twice fails.

parent ba3d8e95
No related branches found
No related tags found
1 merge request!32Dump fix script can be applied twice
......@@ -19,6 +19,11 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
"""Testing the dump update scripts
As a general rule, dump updaters should be idempotent, so tests should run the update again after
the first checks are successlful.
TODO: Reduce the boilerplate for the tests.
"""
import filecmp
......@@ -68,3 +73,13 @@ def test_2024_10_02(tmpdir):
check=True
)
assert filecmp.cmp(output.name, expectedfile), "Output does not match expected output."
with (NamedTemporaryFile(dir=tmpdir, suffix=".sql", delete=True) as output2,
open(output.name, mode="rb") as infile_stream
):
run([script_fullname],
stdin=infile_stream,
stdout=output2,
check=True
)
assert filecmp.cmp(output2.name, expectedfile), (
"Run 2: Output does not match expected output.")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment