Skip to content

Commit 03664eb

Browse files
stanislavlevintvoinarovskyi
authored andcommitted
Fix test_legacy_correct_metadata_response on x86 arch (#1718)
The problem is that the type of required operation result is "long". ``` >>> type(278251978 & 0xffffffff) <type 'long'> ``` However, by default "format" method uses __format__(): ``` >>> (278251978 & 0xffffffff).__format__('') '278251978' ``` So, let's compare things using the same engine: ``` >>> "{!r}".format(278251978 & 0xffffffff) '278251978L' ``` Fixes: #1717 Signed-off-by: Stanislav Levin <[email protected]>
1 parent eed59ba commit 03664eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/record/test_legacy_records.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def test_legacy_correct_metadata_response(magic):
141141
assert meta.timestamp == (9999999 if magic else -1)
142142
assert meta.crc == (-2095076219 if magic else 278251978) & 0xffffffff
143143
assert repr(meta) == (
144-
"LegacyRecordMetadata(offset=0, crc={}, size={}, "
144+
"LegacyRecordMetadata(offset=0, crc={!r}, size={}, "
145145
"timestamp={})".format(meta.crc, meta.size, meta.timestamp)
146146
)
147147

0 commit comments

Comments
 (0)