Commit 800b56a
authored
test: fix operator precedence in manifest v2 assertions (#3612)
Six assertions in test_write_manifest and test_write_manifest_list used
the form `assert x == a if format_version == 1 else b`. Because a
conditional expression binds looser than `==`, Python parses this as
`assert (x == a) if (format_version == 1) else b`, so for the
format_version == 2 parametrization the whole statement collapses to
`assert b`, where b is a truthy constant (3, or ManifestContent.DELETES).
The v2 branch therefore always passed and never compared the actual
value read back from the manifest.
Wrap the right-hand side in parentheses so the conditional expression is
the comparison target. This restores verification of the v2
sequence_number, content, min_sequence_number, and file_sequence_number
on the manifest read/round-trip path. Test-only change; all parametrized
cases (v1 and v2) pass.
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>1 parent d142bd1 commit 800b56a
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
| 427 | + | |
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
590 | | - | |
591 | | - | |
592 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | | - | |
620 | | - | |
| 619 | + | |
| 620 | + | |
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
| |||
0 commit comments