Show More
@@ -0,0 +1,39 b'' | |||
|
1 | from __future__ import absolute_import | |
|
2 | import unittest | |
|
3 | ||
|
4 | try: | |
|
5 | from mercurial import rustext | |
|
6 | except ImportError: | |
|
7 | rustext = None | |
|
8 | ||
|
9 | try: | |
|
10 | from mercurial.cext import parsers as cparsers | |
|
11 | except ImportError: | |
|
12 | cparsers = None | |
|
13 | ||
|
14 | @unittest.skipIf(rustext is None or cparsers is None, | |
|
15 | "rustext.ancestor or the C Extension parsers module " | |
|
16 | "it relies on is not available") | |
|
17 | class rustancestorstest(unittest.TestCase): | |
|
18 | """Test the correctness of binding to Rust code. | |
|
19 | ||
|
20 | This test is merely for the binding to Rust itself: extraction of | |
|
21 | Python variable, giving back the results etc. | |
|
22 | ||
|
23 | It is not meant to test the algorithmic correctness of the operations | |
|
24 | on ancestors it provides. Hence the very simple embedded index data is | |
|
25 | good enough. | |
|
26 | ||
|
27 | Algorithmic correctness is asserted by the Rust unit tests. | |
|
28 | """ | |
|
29 | ||
|
30 | def testmodule(self): | |
|
31 | self.assertTrue('DAG' in rustext.ancestor.__doc__) | |
|
32 | ||
|
33 | def testgrapherror(self): | |
|
34 | self.assertTrue('GraphError' in dir(rustext)) | |
|
35 | ||
|
36 | ||
|
37 | if __name__ == '__main__': | |
|
38 | import silenttestrunner | |
|
39 | silenttestrunner.main(__name__) |
General Comments 0
You need to be logged in to leave comments.
Login now