<s> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> from yaml import load <EOL> try : <EOL> from yaml import CLoader as Loader <EOL> except ImportError : <EOL> from yaml import Loader <EOL> from datatree import Tree <EOL> from datatree . tests . base import NodeTestBase <EOL> class test_YamlRenderer ( unittest . TestCase , NodeTestBase ) : <EOL> def yaml_to_dict ( self , yaml_text ) : <EOL> return load ( yaml_text , Loader = Loader ) <EOL> def test_nested_render ( self ) : <EOL> self . assertDictEqual ( <EOL> self . yaml_to_dict ( self . get_dirty_tree ( ) . render ( '<STR_LIT>' ) ) , <EOL> self . get_dirty_dict ( ) <EOL> ) <EOL> def test_flat_render ( self ) : <EOL> self . assertDictEqual ( <EOL> self . yaml_to_dict ( self . get_flat_tree ( ) ( '<STR_LIT>' ) ) , <EOL> self . get_flat_dict ( ) <EOL> ) </s>
