Module Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Assign NameStore NameLoad Assign NameStore Call AttributeLoad Str attr Assign NameStore Call AttributeLoad Str attr Assign NameStore Call AttributeLoad Str attr FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore ListLoad Str Str Str Str Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad Num Expr Call AttributeLoad NameLoad attr CompareEq Call NameLoad NameLoad NameLoad Assign NameStore Str FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Num NameLoad Expr Call AttributeLoad NameLoad attr CompareEq Call NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore ListLoad NameLoad ListLoad Assign NameStore ListLoad NameLoad NameLoad Assign NameStore Dict Num Num NameLoad ListLoad Assign NameStore Dict Num NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad attr Assign NameStore ListLoad NameLoad NameLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr CompareIn NameLoad NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr CompareNotIn NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad attr Assign NameStore ListLoad NameLoad NameLoad NameLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr CompareIn NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad keyword Num attr Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad keyword Num attr For NameStore AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Assign NameStore Str FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Num attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword Num attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign TupleStore NameStore NameStore Call NameLoad keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad TryFinally body Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr finalbody Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list decorator_list Assign NameStore Str Assign NameStore Dict Str NameLoad FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return NameLoad decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad Call AttributeLoad NameLoad attr keyword Num attr Call NameLoad
N/A N/A copy N/A doctest N/A gc N/A os N/A sys N/A unittest tempfile mkstemp pympler refbrowser pympler.util.compat StringIO TreeTest N/A N/A unittest TestCase N/A N/A sample_tree None N/A TREE_DEP_1 N/A N/A 
root-+-branch1
     +-branch2
     +-branch3
     strip N/A TREE_DEP_2 N/A N/A 
root-+-branch1-+-a
     |         +-b
     |         +-c
     |         +-d
     |         +-e
     |
     +-branch2-+-branch3
     |         +-a
     |         +-b
     |         +-c
     |         +-d
     |         +-e
     |
     +-branch3-+-branch1
               +-a
               +-b
               +-c
               +-d
               +-e
     strip N/A TREE_DEP_4 N/A N/A 
root-+-branch1-+-a
     |         +-b
     |         +-c
     |         +-d
     |         +-e
     |
     +-branch2-+-branch3-+-branch1-+-a
     |         |         |         +-b
     |         |         |         +-c
     |         |         |         +-d
     |         |         |         +-e
     |         |         |
     |         |         +-a
     |         |         +-b
     |         |         +-c
     |         |         +-d
     |         |         +-e
     |         |
     |         +-a
     |         +-b
     |         +-c
     |         +-d
     |         +-e
     |
     +-branch3-+-branch1-+-a
               |         +-b
               |         +-c
               |         +-d
               |         +-e
               |
               +-a
               +-b
               +-c
               +-d
               +-e
     strip setUp N/A N/A self N/A N/A N/A N/A TreeTest sample_tree N/A N/A refbrowser _Node root N/A branch1 N/A N/A refbrowser _Node branch1 N/A N/A N/A N/A N/A TreeTest sample_tree children append branch1 N/A branch2 N/A N/A refbrowser _Node branch2 N/A N/A N/A N/A N/A TreeTest sample_tree children append branch2 N/A branch3 N/A N/A refbrowser _Node branch3 N/A N/A N/A N/A N/A TreeTest sample_tree children append branch3 N/A N/A N/A N/A branch2 children append branch3 N/A N/A N/A N/A branch3 children append branch1 N/A i N/A a b c d e N/A N/A N/A N/A N/A branch1 children append i N/A N/A N/A N/A branch2 children append i N/A N/A N/A N/A branch3 children append i N/A tearDown N/A N/A self N/A N/A N/A Need to delete reference cycles, otherwise test data will affect
        garbage graph tests. N/A N/A N/A gc collect N/A test_node N/A N/A self N/A N/A N/A Test node functionality.

        _Nodes can be created, linked to each other, and the output function
        should return the expected result.

         N/A n N/A N/A refbrowser _Node 1 N/A expected N/A str 1 N/A N/A N/A self assert_ N/A N/A str n expected N/A expected the quick brown fox foo N/A N/A o N/A N/A N/A expected N/A N/A n N/A N/A refbrowser _Node 1 foo N/A N/A N/A self assert_ N/A N/A str n expected N/A N/A N/A N/A n children append 2 N/A test_get_tree N/A N/A self N/A N/A N/A Test reference browser tree representation. N/A root root id N/A ref1 N/A root N/A N/A ref11 N/A ref1 root N/A ref2 N/A 1 2 root N/A N/A ref22 N/A 1 ref2 N/A res N/A N/A N/A N/A refbrowser RefBrowser root repeat False get_tree N/A refs N/A ref1 ref2 N/A children N/A N/A c o N/A c N/A res children N/A isinstance c N/A refbrowser _Node N/A r refs N/A N/A N/A N/A self assert_ N/A r children N/A %s not in children r N/A N/A N/A self assert_ N/A ref11 children N/A res N/A N/A N/A N/A refbrowser RefBrowser root repeat True get_tree N/A refs N/A ref1 ref11 ref2 N/A children N/A N/A c o N/A c N/A res children N/A isinstance c N/A refbrowser _Node N/A r refs N/A N/A N/A N/A self assert_ N/A r children N/A res N/A N/A N/A N/A refbrowser RefBrowser root maxdepth 0 get_tree N/A N/A N/A self assertEqual N/A len N/A res children 0 N/A res N/A N/A N/A N/A refbrowser RefBrowser root maxdepth 1 get_tree N/A c N/A res children N/A N/A N/A c ref1 N/A N/A N/A N/A self assertEqual N/A len N/A c children 0 N/A expected the quick brown fox foo N/A N/A o N/A N/A N/A expected N/A N/A res N/A N/A N/A N/A refbrowser RefBrowser root str_func foo maxdepth 2 get_tree N/A N/A N/A self assertEqual N/A str res expected N/A res N/A N/A N/A N/A refbrowser RefBrowser root str_func foo repeat True maxdepth 2 get_tree N/A N/A N/A self assertEqual N/A str res expected N/A test_console_browser N/A N/A self N/A N/A N/A Test ConsoleBrowser uses stdout by default. N/A crb N/A N/A refbrowser ConsoleBrowser None maxdepth 2 N/A N/A N/A self assertEqual N/A crb stream N/A sys stdout N/A test_file_browser N/A N/A self N/A N/A N/A crb N/A N/A refbrowser FileBrowser None maxdepth 1 N/A N/A fhandle fname N/A mkstemp prefix test_file_browser text True N/A N/A N/A os close fhandle N/A N/A N/A N/A N/A crb print_tree fname tree N/A self sample_tree N/A output N/A N/A N/A open fname read N/A N/A N/A self assertEqual N/A N/A output strip N/A self TREE_DEP_1 N/A N/A N/A N/A os unlink fname N/A test_print_tree N/A N/A self N/A N/A N/A Test reference browser prints root object by default. N/A out1 N/A StringIO N/A crb N/A N/A refbrowser StreamBrowser N/A N/A copy copy N/A self sample_tree maxdepth 1 stream out1 N/A N/A N/A crb print_tree N/A N/A crb get_tree N/A out2 N/A StringIO N/A crb N/A N/A refbrowser StreamBrowser N/A N/A copy copy N/A self sample_tree maxdepth 1 stream out2 N/A N/A N/A crb print_tree N/A N/A N/A self assertEqual N/A N/A out1 getvalue N/A N/A out2 getvalue N/A test_reference_browser_max_depth N/A N/A self N/A N/A N/A Test different reference tree depth settings. N/A stream N/A StringIO N/A crb N/A N/A refbrowser StreamBrowser None maxdepth 1 stream stream N/A N/A N/A crb print_tree N/A self sample_tree N/A N/A N/A self assertEqual N/A N/A N/A N/A stream getvalue strip N/A self TREE_DEP_1 N/A stream N/A StringIO N/A crb N/A N/A refbrowser StreamBrowser None maxdepth 2 stream stream N/A N/A N/A crb print_tree N/A self sample_tree N/A N/A N/A self assertEqual N/A N/A N/A N/A stream getvalue strip N/A self TREE_DEP_2 N/A stream N/A StringIO N/A crb N/A N/A refbrowser StreamBrowser None maxdepth 4 stream stream N/A N/A N/A crb print_tree N/A self sample_tree N/A N/A N/A self assertEqual N/A N/A N/A N/A stream getvalue strip N/A self TREE_DEP_4 N/A N/A N/A test_print_tree 

let's start with a small tree first
>>> crb = refbrowser.ConsoleBrowser(None, maxdepth=1)
>>> crb.print_tree(TreeTest.sample_tree)
root-+-branch1
     +-branch2
     +-branch3

okay, next level
>>> crb = refbrowser.ConsoleBrowser(None, maxdepth=2)
>>> crb.print_tree(TreeTest.sample_tree)
root-+-branch1-+-a
     |         +-b
     |         +-c
     |         +-d
     |         +-e
     |
     +-branch2-+-branch3
     |         +-a
     |         +-b
     |         +-c
     |         +-d
     |         +-e
     |
     +-branch3-+-branch1
               +-a
               +-b
               +-c
               +-d
               +-e

and now full size

>>> crb = refbrowser.ConsoleBrowser(None, maxdepth=4)
>>> crb.print_tree(TreeTest.sample_tree)
root-+-branch1-+-a
     |         +-b
     |         +-c
     |         +-d
     |         +-e
     |
     +-branch2-+-branch3-+-branch1-+-a
     |         |         |         +-b
     |         |         |         +-c
     |         |         |         +-d
     |         |         |         +-e
     |         |         |
     |         |         +-a
     |         |         +-b
     |         |         +-c
     |         |         +-d
     |         |         +-e
     |         |
     |         +-a
     |         +-b
     |         +-c
     |         +-d
     |         +-e
     |
     +-branch3-+-branch1-+-a
               |         +-b
               |         +-c
               |         +-d
               |         +-e
               |
               +-a
               +-b
               +-c
               +-d
               +-e
 N/A __test__ N/A test_print_tree test_print_tree suite N/A N/A N/A N/A N/A suite N/A N/A unittest makeSuite TreeTest test N/A N/A N/A suite addTest N/A N/A doctest DocTestSuite N/A suite N/A N/A N/A __name__ __main__ N/A N/A N/A N/A N/A N/A unittest TextTestRunner verbosity 2 run N/A suite