@@ -944,26 +944,43 @@ def testLoadConfigNoConfig(self):
944944 print (cm .exception )
945945 self .assertEqual (cm .exception .args [0 ], self .dirname )
946946
947- def testCopyConfig (self ):
948947
948+ def testXhtmlRaisesOptionError (self ):
949949 self .munge_configini (mods = [ ("html_version = " , "xhtml" ) ])
950950
951951 config = configuration .CoreConfig ()
952952
953953 # verify config is initalized to defaults
954954 self .assertEqual (config ['HTML_VERSION' ], 'html4' )
955955
956+
957+ with self .assertRaises (configuration .OptionValueError ) as cm :
958+ # load config
959+ config .load (self .dirname )
960+
961+ print (cm .exception )
962+ self .assertEqual (str (cm .exception ),
963+ "Invalid value for HTML_VERSION: 'xhtml'\n "
964+ "Allowed values: html4" )
965+
966+ def testCopyConfig (self ):
967+
968+ self .munge_configini (mods = [ ("static_files = " , "html2" ) ])
969+
970+ config = configuration .CoreConfig ()
971+
972+ # verify config is initalized to defaults
973+ self .assertEqual (config ['STATIC_FILES' ], None )
974+
956975 # load config
957976 config .load (self .dirname )
958-
959- # loaded new option
960- self .assertEqual (config ['HTML_VERSION' ], 'xhtml' )
977+ self .assertEqual (config ['STATIC_FILES' ], ['_test_instance/html2' ])
961978
962979 # copy config
963980 config_copy = config .copy ()
964981
965982 # this should work
966- self .assertEqual (config_copy ['HTML_VERSION ' ], 'xhtml' )
983+ self .assertEqual (config_copy ['STATIC_FILES ' ], [ '_test_instance/html2' ] )
967984
968985 @skip_py2
969986 def testConfigValueInterpolateError (self ):
0 commit comments