tests/test-rust-ancestor.py
branchstable
changeset 41350 ab0d762d89ef
parent 41246 619ee4039bd4
child 41694 0c7b353ce100
--- a/tests/test-rust-ancestor.py	Wed Jan 23 07:47:04 2019 -0500
+++ b/tests/test-rust-ancestor.py	Wed Jan 23 07:49:36 2019 -0500
@@ -2,6 +2,11 @@
 import sys
 import unittest
 
+from mercurial import (
+    error,
+    node,
+)
+
 try:
     from mercurial import rustext
     rustext.__name__  # trigger immediate actual import
@@ -153,6 +158,12 @@
         # rust-cpython issues appropriate str instances for Python 2 and 3
         self.assertEqual(exc.args, ('ParentOutOfRange', 1))
 
+    def testwdirunsupported(self):
+        # trying to access ancestors of the working directory raises
+        # WdirUnsupported directly
+        idx = self.parseindex()
+        with self.assertRaises(error.WdirUnsupported):
+            list(AncestorsIterator(idx, [node.wdirrev], -1, False))
 
 if __name__ == '__main__':
     import silenttestrunner