changeset 42759:791791a1fd4e

tests: split joint repo/changelog fake into one for each type I'm just not comfortable with fakes that get overloaded for multiple types: too often it gets out of hand and becomes difficult to trace. Differential Revision: https://phab.mercurial-scm.org/D6725
author Augie Fackler <augie@google.com>
date Wed, 14 Aug 2019 16:11:45 -0400
parents e9f503074044
children 9f2189b6bf2a
files tests/test-rust-discovery.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-rust-discovery.py	Tue Aug 13 14:28:10 2019 -0700
+++ b/tests/test-rust-discovery.py	Wed Aug 14 16:11:45 2019 -0400
@@ -31,11 +31,14 @@
     b'\x00\x00\x00\x00\x00\x00\x00\x00\x00'
     )
 
+class fakechangelog(object):
+    def __init__(self, idx):
+        self.index = idx
+
 class fakerepo(object):
     def __init__(self, idx):
         """Just make so that self.changelog.index is the given idx."""
-        self.index = idx
-        self.changelog = self
+        self.changelog = fakechangelog(idx)
 
 @unittest.skipIf(PartialDiscovery is None or cparsers is None,
                  "rustext or the C Extension parsers module "