<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals , print_function <EOL> import os <EOL> import nose <EOL> from nose . tools import assert_equal , assert_true , assert_false <EOL> from xonsh . wizard import ( Node , Wizard , Pass , PrettyFormatter , <EOL> Message , Question , StateVisitor ) <EOL> TREE0 = Wizard ( children = [ Pass ( ) , Message ( message = '<STR_LIT>' ) ] ) <EOL> TREE1 = Question ( '<STR_LIT>' , { '<STR_LIT>' : Pass ( ) } ) <EOL> def test_pretty_format_tree0 ( ) : <EOL> exp = ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> "<STR_LIT>" <EOL> '<STR_LIT>' ) <EOL> obs = PrettyFormatter ( TREE0 ) . visit ( ) <EOL> yield assert_equal , exp , obs <EOL> yield assert_equal , exp , str ( TREE0 ) <EOL> yield assert_equal , exp . replace ( '<STR_LIT:\n>' , '<STR_LIT>' ) , repr ( TREE0 ) <EOL> def test_pretty_format_tree1 ( ) : <EOL> exp = ( '<STR_LIT>' <EOL> "<STR_LIT>" <EOL> '<STR_LIT>' <EOL> "<STR_LIT>" <EOL> '<STR_LIT>' <EOL> '<STR_LIT:)>' ) <EOL> obs = PrettyFormatter ( TREE1 ) . visit ( ) <EOL> yield assert_equal , exp , obs <EOL> yield assert_equal , exp , str ( TREE1 ) <EOL> yield assert_equal , exp . replace ( '<STR_LIT:\n>' , '<STR_LIT>' ) , repr ( TREE1 ) <EOL> def test_state_visitor_store ( ) : <EOL> exp = { '<STR_LIT>' : [ { } , { } , { '<STR_LIT>' : '<STR_LIT>' } ] } <EOL> sv = StateVisitor ( ) <EOL> sv . store ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> obs = sv . state <EOL> yield assert_equal , exp , obs <EOL> exp [ '<STR_LIT>' ] [ <NUM_LIT:1> ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> sv . store ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> yield assert_equal , exp , obs <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> nose . runmodule ( ) </s>
