|
6 | 6 | from polyfile.fileutils import Tempfile |
7 | 7 |
|
8 | 8 |
|
9 | | -class TestASTNode: |
| 9 | +class MockASTNode: |
10 | 10 | def __init__( |
11 | 11 | self, |
12 | 12 | name: str, |
13 | 13 | offset: Optional[int] = None, |
14 | 14 | length: Optional[int] = None, |
15 | | - children: Iterable["TestASTNode"] = () |
| 15 | + children: Iterable["MockASTNode"] = () |
16 | 16 | ): |
17 | 17 | self.name: str = name |
18 | 18 | if offset is not None: |
19 | 19 | setattr(self, "offset", offset) |
20 | 20 | if length is not None: |
21 | 21 | setattr(self, "length", length) |
22 | | - self.children: Tuple[TestASTNode, ...] = tuple(children) |
| 22 | + self.children: Tuple[MockASTNode, ...] = tuple(children) |
23 | 23 |
|
24 | 24 |
|
25 | 25 | class ASTTest(TestCase): |
26 | | - example_obj = TestASTNode(name="root", children=[ |
27 | | - TestASTNode(name="child1", offset=0, length=10, children=[ |
28 | | - TestASTNode(name="grandchild1", offset=5, length=5) |
| 26 | + example_obj = MockASTNode(name="root", children=[ |
| 27 | + MockASTNode(name="child1", offset=0, length=10, children=[ |
| 28 | + MockASTNode(name="grandchild1", offset=5, length=5) |
29 | 29 | ]), |
30 | | - TestASTNode(name="child2", offset=10, length=10, children=[ |
31 | | - TestASTNode(name="grandchild2", offset=10, length=3), |
32 | | - TestASTNode(name="grandchild3", offset=13, length=7) |
| 30 | + MockASTNode(name="child2", offset=10, length=10, children=[ |
| 31 | + MockASTNode(name="grandchild2", offset=10, length=3), |
| 32 | + MockASTNode(name="grandchild3", offset=13, length=7) |
33 | 33 | ]) |
34 | 34 | ]) |
35 | 35 |
|
|
0 commit comments