Three-level tree: root ├── a │ ├── a1 │ └── a2 └── b
()
| 24 | |
| 25 | |
| 26 | def _make_tree() -> _SampleTree: |
| 27 | """Three-level tree: |
| 28 | |
| 29 | root |
| 30 | ├── a |
| 31 | │ ├── a1 |
| 32 | │ └── a2 |
| 33 | └── b |
| 34 | """ |
| 35 | a1_id, a2_id = uuid4(), uuid4() |
| 36 | a_id = uuid4() |
| 37 | b_id = uuid4() |
| 38 | root_id = uuid4() |
| 39 | a1 = TreeNode( |
| 40 | node_id=a1_id, |
| 41 | parent_id=a_id, |
| 42 | position=0, |
| 43 | title="A1", |
| 44 | summary="leaf a1", |
| 45 | ) |
| 46 | a2 = TreeNode( |
| 47 | node_id=a2_id, |
| 48 | parent_id=a_id, |
| 49 | position=1, |
| 50 | title="A2", |
| 51 | summary="leaf a2", |
| 52 | ) |
| 53 | a = TreeNode( |
| 54 | node_id=a_id, |
| 55 | parent_id=root_id, |
| 56 | position=0, |
| 57 | title="A", |
| 58 | summary="branch a", |
| 59 | children_ids=[a1_id, a2_id], |
| 60 | ) |
| 61 | b = TreeNode( |
| 62 | node_id=b_id, |
| 63 | parent_id=root_id, |
| 64 | position=1, |
| 65 | title="B", |
| 66 | summary="leaf b", |
| 67 | ) |
| 68 | root = TreeNode( |
| 69 | node_id=root_id, |
| 70 | parent_id=None, |
| 71 | position=0, |
| 72 | title="Root", |
| 73 | summary="root summary", |
| 74 | children_ids=[a_id, b_id], |
| 75 | ) |
| 76 | return _SampleTree( |
| 77 | as_of=_now(), |
| 78 | source=_src(), |
| 79 | root_node_id=root_id, |
| 80 | nodes={n.node_id: n for n in [root, a, b, a1, a2]}, |
| 81 | ) |
| 82 | |
| 83 |
no test coverage detected