MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / test_ignore_wal_replay_errors

Function test_ignore_wal_replay_errors

tools/shell/test/test_shell_flags.py:567–586  ·  view source on GitHub ↗
(temp_db, flag)

Source from the content-addressed store, hash-verified

565 ["-w", "--ignore_wal_replay_errors"],
566)
567def test_ignore_wal_replay_errors(temp_db, flag) -> None:
568 # Create an initial DB
569 test = ShellTest().add_argument(temp_db).statement("return 1")
570 result = test.run()
571
572 # create garbage WAL file
573 with open(temp_db + ".wal", "w") as wal_file:
574 wal_file.write("abcdefghijklmnopqrstuvwxyz")
575
576 # Test with ignore_wal_replay_errors off
577 test = ShellTest().add_argument(temp_db)
578 result = test.run()
579 result.check_stderr("Checksum verification failed")
580
581 # Test with ignore_wal_replay_errors on
582 with open(temp_db + ".wal", "w") as wal_file:
583 wal_file.write("abcdefghijklmnopqrstuvwxyz")
584 test = ShellTest().add_argument(temp_db).add_argument(flag).statement("RETURN 1")
585 result = test.run()
586 result.check_stdout("1")
587
588
589@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 7

ShellTestClass · 0.90
statementMethod · 0.80
add_argumentMethod · 0.80
check_stderrMethod · 0.80
check_stdoutMethod · 0.80
runMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected