(temp_db, flag)
| 565 | ["-w", "--ignore_wal_replay_errors"], |
| 566 | ) |
| 567 | def 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( |
nothing calls this directly
no test coverage detected