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
All threads resolved!
3 files
+ 19
2
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -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.")
Loading