@@ -944,26 +944,43 @@ def testLoadConfigNoConfig(self):
944
944
print (cm .exception )
945
945
self .assertEqual (cm .exception .args [0 ], self .dirname )
946
946
947
- def testCopyConfig (self ):
948
947
948
+ def testXhtmlRaisesOptionError (self ):
949
949
self .munge_configini (mods = [ ("html_version = " , "xhtml" ) ])
950
950
951
951
config = configuration .CoreConfig ()
952
952
953
953
# verify config is initalized to defaults
954
954
self .assertEqual (config ['HTML_VERSION' ], 'html4' )
955
955
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
+
956
975
# load config
957
976
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' ])
961
978
962
979
# copy config
963
980
config_copy = config .copy ()
964
981
965
982
# this should work
966
- self .assertEqual (config_copy ['HTML_VERSION ' ], 'xhtml' )
983
+ self .assertEqual (config_copy ['STATIC_FILES ' ], [ '_test_instance/html2' ] )
967
984
968
985
@skip_py2
969
986
def testConfigValueInterpolateError (self ):
0 commit comments