Skip to content
Snippets Groups Projects

Dump fix script can be applied twice

Merged Daniel Hornung requested to merge f-fix-dump-upgrade into dev
1 file
+ 15
0
Compare changes
  • Side-by-side
  • Inline
@@ -19,6 +19,11 @@
@@ -19,6 +19,11 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
"""Testing the dump update scripts
"""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
import filecmp
@@ -68,3 +73,13 @@ def test_2024_10_02(tmpdir):
@@ -68,3 +73,13 @@ def test_2024_10_02(tmpdir):
check=True
check=True
)
)
assert filecmp.cmp(output.name, expectedfile), "Output does not match expected output."
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.")
Loading