<s> from tests . markup . _util import alternate_expectation , desired_output <EOL> def simple_schema ( ) : <EOL> from flatland import Form , String <EOL> class SmallForm ( Form ) : <EOL> name = "<STR_LIT:test>" <EOL> valued = String <EOL> empty = String <EOL> return SmallForm ( { u'<STR_LIT>' : u'<STR_LIT>' } ) <EOL> @ desired_output ( '<STR_LIT>' , simple_schema ) <EOL> def value_default ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_default . genshi_06 <EOL> def test_value_default_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_default . genshi_05 <EOL> def test_value_default_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_default . markup <EOL> def test_value_default_markup ( gen , el ) : <EOL> return gen . input ( el [ '<STR_LIT>' ] ) <EOL> @ desired_output ( '<STR_LIT>' , simple_schema ) <EOL> def value_disabled ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_disabled . genshi_06 <EOL> def test_with_value_disabled_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_disabled . genshi_05 <EOL> def test_with_value_disabled_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_disabled . markup <EOL> def test_with_value_disabled_markup ( gen , el ) : <EOL> gen . begin ( auto_value = False ) <EOL> output = gen . input ( el [ '<STR_LIT>' ] ) <EOL> gen . end ( ) <EOL> return output <EOL> @ value_disabled . genshi_06 <EOL> def test_set_value_disabled_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_disabled . genshi_05 <EOL> def test_set_value_disabled_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_disabled . markup <EOL> def test_set_value_disabled_markup ( gen , el ) : <EOL> gen . set ( auto_value = False ) <EOL> output = gen . input ( el [ '<STR_LIT>' ] ) <EOL> return output <EOL> @ value_disabled . genshi_06 <EOL> def test_element_value_disabled_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_disabled . genshi_05 <EOL> def test_element_value_disabled_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_disabled . markup <EOL> def test_element_value_disabled_markup ( gen , el ) : <EOL> return gen . input ( el [ '<STR_LIT>' ] , auto_value = False ) <EOL> @ value_disabled . genshi_06 <EOL> def test_element_value_auto_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_disabled . genshi_05 <EOL> def test_element_value_auto_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ value_disabled . markup <EOL> def test_element_value_auto_markup ( gen , el ) : <EOL> gen . begin ( auto_value = False ) <EOL> output = gen . input ( el [ '<STR_LIT>' ] , auto_value = "<STR_LIT>" ) <EOL> gen . end ( ) <EOL> return output <EOL> @ desired_output ( '<STR_LIT>' , simple_schema ) <EOL> def name_default ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_default . genshi_06 <EOL> def test_name_default_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_default . genshi_05 <EOL> def test_name_default_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_default . markup <EOL> def test_name_default_markup ( gen , el ) : <EOL> return gen . form ( el ) <EOL> @ desired_output ( '<STR_LIT>' , simple_schema ) <EOL> def name_disabled ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_disabled . genshi_06 <EOL> def test_with_name_disabled_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_disabled . genshi_05 <EOL> def test_with_name_disabled_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_disabled . markup <EOL> def test_with_name_disabled_markup ( gen , el ) : <EOL> gen . begin ( auto_name = False ) <EOL> output = gen . form ( el ) <EOL> gen . end ( ) <EOL> return output <EOL> @ name_disabled . genshi_06 <EOL> def test_set_name_disabled_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_disabled . genshi_05 <EOL> def test_set_name_disabled_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_disabled . markup <EOL> def test_set_name_disabled_markup ( gen , el ) : <EOL> gen . set ( auto_name = False ) <EOL> output = gen . form ( el ) <EOL> return output <EOL> @ name_disabled . genshi_06 <EOL> def test_element_name_disabled_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_disabled . genshi_05 <EOL> def test_element_name_disabled_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_disabled . markup <EOL> def test_element_name_disabled_markup ( gen , el ) : <EOL> return gen . form ( el , auto_name = False ) <EOL> @ name_disabled . genshi_06 <EOL> def test_element_name_auto_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_disabled . genshi_05 <EOL> def test_element_name_auto_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ name_disabled . markup <EOL> def test_element_name_auto_markup ( gen , el ) : <EOL> gen . begin ( auto_name = False ) <EOL> output = gen . form ( el , auto_name = "<STR_LIT>" ) <EOL> gen . end ( ) <EOL> return output <EOL> @ desired_output ( '<STR_LIT>' , simple_schema ) <EOL> def domid_default ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_default . genshi_06 <EOL> def test_domid_default_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_default . genshi_05 <EOL> def test_domid_default_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_default . markup <EOL> def test_domid_default_markup ( gen , el ) : <EOL> return gen . select ( el [ '<STR_LIT>' ] ) <EOL> @ desired_output ( '<STR_LIT>' , simple_schema ) <EOL> @ alternate_expectation ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def domid_enabled ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_enabled . genshi_06 <EOL> def test_with_domid_enabled_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_enabled . genshi_05 <EOL> def test_with_domid_enabled_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_enabled . markup <EOL> def test_with_domid_enabled_markup ( gen , el ) : <EOL> gen . begin ( auto_domid = True , domid_format = "<STR_LIT>" ) <EOL> output = gen . select ( el [ '<STR_LIT>' ] ) <EOL> gen . end ( ) <EOL> return output <EOL> @ domid_enabled . genshi_06 <EOL> def test_set_domid_enabled_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_enabled . genshi_05 <EOL> def test_set_domid_enabled_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_enabled . markup <EOL> def test_set_domid_enabled_markup ( gen , el ) : <EOL> gen . set ( auto_domid = True , domid_format = "<STR_LIT>" ) <EOL> return gen . select ( el [ '<STR_LIT>' ] ) <EOL> @ domid_enabled . genshi_06 <EOL> def test_element_domid_enabled_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_enabled . genshi_05 <EOL> def test_element_domid_enabled_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_enabled . markup <EOL> def test_element_domid_enabled_markup ( gen , el ) : <EOL> gen . set ( domid_format = "<STR_LIT>" ) <EOL> return gen . select ( el [ '<STR_LIT>' ] , auto_domid = True ) <EOL> @ domid_enabled . genshi_06 <EOL> def test_element_domid_auto_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_enabled . genshi_05 <EOL> def test_element_domid_auto_genshi_05 ( ) : <EOL> """<STR_LIT>""" <EOL> @ domid_enabled . markup <EOL> def test_element_domid_auto_markup ( gen , el ) : <EOL> gen . begin ( auto_domid = True , domid_format = "<STR_LIT>" ) <EOL> output = gen . select ( el [ '<STR_LIT>' ] , auto_domid = "<STR_LIT>" ) <EOL> gen . end ( ) <EOL> return output <EOL> def filter1 ( tagname , attributes , contents , context , bind ) : <EOL> attributes [ '<STR_LIT:class>' ] = '<STR_LIT>' <EOL> contents += '<STR_LIT>' <EOL> return contents <EOL> @ desired_output ( '<STR_LIT>' , simple_schema , funky_filter = filter1 ) <EOL> def filter_enabled ( ) : <EOL> """<STR_LIT>""" <EOL> @ filter_enabled . genshi_06 <EOL> def test_with_filter_enabled_genshi_06 ( ) : <EOL> """<STR_LIT>""" <EOL> @ filter_enabled . markup <EOL> def test_with_filter_enabled_markup ( gen , el , funky_filter ) : <EOL> gen . begin ( auto_filter = True , filters = [ funky_filter ] ) <EOL> output = gen . label ( el [ '<STR_LIT>' ] , contents = '<STR_LIT>' ) <EOL> gen . end ( ) <EOL> return output </s>
