#NEWLINE# def test_nesting( self ) : #NEWLINE# #INDENT# pages_config = [ { #NEWLINE# #INDENT# 'Home' : 'index.md' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'Install' : [ { #NEWLINE# #INDENT# 'Pre-install' : 'install/install-pre.md' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'The install' : 'install/install-actual.md' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'Post install' : 'install/install-post.md' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'Guide' : [ { #NEWLINE# #INDENT# 'Tutorial' : [ { #NEWLINE# #INDENT# 'Getting Started' : 'guide/tutorial/running.md' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'Advanced Features' : 'guide/tutorial/testing.md' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'Further Reading' : 'guide/tutorial/debugging.md' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'API Reference' : [ { #NEWLINE# #INDENT# 'Feature 1' : 'guide/api-ref/running.md' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'Feature 2' : 'guide/api-ref/testing.md' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'Feature 3' : 'guide/api-ref/debugging.md' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'Testing' : 'guide/testing.md' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'Deploying' : 'guide/deploying.md' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } ] #NEWLINE# site_navigation = nav . SiteNavigation ( pages_config ) #NEWLINE# self . assertEqual ( [ n . title for n in site_navigation . nav_items ] , [ 'Home' , 'Install' , 'Guide' ] ) #NEWLINE# self . assertEqual ( len ( site_navigation . pages ) , 12 ) #NEWLINE# expected = dedent ( '\n        Home - /\n        Install\n            Pre-install - /install/install-pre/\n            The install - /install/install-actual/\n            Post install - /install/install-post/\n        Guide\n            Tutorial\n                Getting Started - /guide/tutorial/running/\n                Advanced Features - /guide/tutorial/testing/\n                Further Reading - /guide/tutorial/debugging/\n            API Reference\n                Feature 1 - /guide/api-ref/running/\n                Feature 2 - /guide/api-ref/testing/\n                Feature 3 - /guide/api-ref/debugging/\n            Testing - /guide/testing/\n            Deploying - /guide/deploying/\n        ' ) #NEWLINE# self . maxDiff = None #NEWLINE# self . assertEqual ( str ( site_navigation ) . strip ( ) , pages_config )