#NEWLINE# def test_get_section_lazy( self ) : #NEWLINE# #INDENT# 'Test getting a section of the state lazily\n        ' #NEWLINE# state [ 'a.a' ] = 12 #NEWLINE# state [ 'a.b' ] = 13 #NEWLINE# state [ 'c' ] = 24 #NEWLINE# self . assertIn ( 'a' , state ) #NEWLINE# section_a = state [ 'a' ] #NEWLINE# self . assertIn ( 'a' , section_a ) #NEWLINE# self . assertIn ( 'b' , section_a ) #NEWLINE# self . assertNotIn ( 'c' , section_a ) #NEWLINE# self . assertEqual ( section_a [ 'a' ] , 12 ) #NEWLINE# self . assertEqual ( section_a [ 'b' ] , 13 ) #NEWLINE# with tempfile . NamedTemporaryFile ( ) as temp : #NEWLINE# #INDENT# state . save ( temp . name ) #NEWLINE# state . reset_instance ( ) #NEWLINE# self . assertNotIn ( 'a' , state ) #NEWLINE# state . load ( temp . name ) #NEWLINE# self . assertIn ( 'a' , state ) #NEWLINE# section_a = state [ 'a' ] #NEWLINE# self . assertIn ( 'a' , section_a ) #NEWLINE# self . assertIn ( 'b' , section_a ) #NEWLINE# self . assertNotIn ( 'c' , section_a ) #NEWLINE# self . assertEqual ( section_a [ 'a' ] , 12 ) #NEWLINE# self . assertEqual ( section_a [ 'b' ] , 13 )