Mercurial > public > mercurial-scm > hg-stable
diff tests/test-rust-revlog.py @ 52806:6a70e4931773
rust-pyo3-revlog: ReadingContextManager
Stepping aside from the implementation of index methods to show
that this will not be a problem.
The test basically only demonstrates that it behaves like a
context manager indeed ? of course our fixture does not provide
any reasonable file access.
author | Georges Racinet <georges.racinet@cloudcrane.io> |
---|---|
date | Mon, 23 Dec 2024 00:17:03 +0100 |
parents | acae91fad6be |
children | adf91dfe6c04 |
line wrap: on
line diff
--- a/tests/test-rust-revlog.py Sun Dec 22 17:02:09 2024 +0100 +++ b/tests/test-rust-revlog.py Mon Dec 23 00:17:03 2024 +0100 @@ -156,6 +156,16 @@ del idx[3] self.assertTrue(nt.is_invalidated()) + def test_reading_context_manager(self): + irl = self.make_inner_revlog() + try: + with irl.reading(): + # not much to do yet + pass + except error.RevlogError as exc: + # well our data file does not even exist + self.assertTrue(b"when reading Just a path/test.d" in exc.args[0]) + # Conditional skipping done by the base class class RustInnerRevlogTest(