Otherwise we get various type mismatches.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Otherwise we get various type mismatches.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | tests/test-remotefilelog-histpack.py (6 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Gregory Szorc | Jan 22 2019, 9:24 PM |
try: | try: | ||||
pack.add(b'filename', nullid, nullid, nullid, nullid, None) | pack.add(b'filename', nullid, nullid, nullid, nullid, None) | ||||
self.assertTrue(False, "historypack.add should throw") | self.assertTrue(False, "historypack.add should throw") | ||||
except RuntimeError: | except RuntimeError: | ||||
pass | pass | ||||
def testBadVersionThrows(self): | def testBadVersionThrows(self): | ||||
pack = self.createPack() | pack = self.createPack() | ||||
path = pack.path + '.histpack' | path = pack.path + b'.histpack' | ||||
with open(path) as f: | with open(path, 'rb') as f: | ||||
raw = f.read() | raw = f.read() | ||||
raw = struct.pack('!B', 255) + raw[1:] | raw = struct.pack('!B', 255) + raw[1:] | ||||
os.chmod(path, os.stat(path).st_mode | stat.S_IWRITE) | os.chmod(path, os.stat(path).st_mode | stat.S_IWRITE) | ||||
with open(path, 'w+') as f: | with open(path, 'wb+') as f: | ||||
f.write(raw) | f.write(raw) | ||||
try: | try: | ||||
pack = historypack.historypack(pack.path) | pack = historypack.historypack(pack.path) | ||||
self.assertTrue(False, "bad version number should have thrown") | self.assertTrue(False, "bad version number should have thrown") | ||||
except RuntimeError: | except RuntimeError: | ||||
pass | pass | ||||