2 from pysize
.core
import pysize_fs_tree
3 from pysize
.core
.pysize_global_fs_cache
import drop_caches
5 class TestFsTree(unittest
.TestCase
):
7 tree
= pysize_fs_tree
.pysize_tree(['/tmp/pysize_example_dir'], 10, 0.02)
9 child
= tree
.get_first_child(tree
.get_first_child(root
))
10 self
.assertEqual(tree
.get_previous_sibling(child
), None)
11 child
= tree
.get_first_child(tree
.get_first_child(child
))
12 self
.assertEqual(tree
.get_previous_sibling(child
), None)
13 parent
= tree
.get_parent(tree
.get_parent(child
))
14 parent
= tree
.get_parent(tree
.get_parent(parent
))
15 self
.assertEqual(parent
, root
)
16 next
= tree
.get_next_sibling(child
)
17 self
.assertEqual(tree
.get_previous_sibling(next
), child
)
20 next
= tree
.get_next_sibling(next
)
22 self
.assertEqual(count
, 9)