File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -905,6 +905,32 @@ def test_missing_envs(self):
905905 self .assertIsNone (self .config .section1 .value1 ())
906906 self .assertEqual (self .config .section1 .value2 (), '/path' )
907907
908+ @unittest .skipIf (sys .version_info [:2 ] == (3 , 4 ), 'PyYAML does not support Python 3.4' )
909+ def test_option_missing_envs (self ):
910+ del os .environ ['CONFIG_TEST_ENV' ]
911+ del os .environ ['CONFIG_TEST_PATH' ]
912+
913+ self .config .option .from_yaml (self .config_file )
914+
915+ self .assertEqual (
916+ self .config .option (),
917+ {
918+ 'section1' : {
919+ 'value1' : None ,
920+ 'value2' : '/path' ,
921+ },
922+ },
923+ )
924+ self .assertEqual (
925+ self .config .option .section1 (),
926+ {
927+ 'value1' : None ,
928+ 'value2' : '/path' ,
929+ },
930+ )
931+ self .assertIsNone (self .config .option .section1 .value1 ())
932+ self .assertEqual (self .config .option .section1 .value2 (), '/path' )
933+
908934 @unittest .skipIf (sys .version_info [:2 ] == (3 , 4 ), 'PyYAML does not support Python 3.4' )
909935 def test_default_values (self ):
910936 os .environ ['DEFINED' ] = 'defined'
You can’t perform that action at this time.
0 commit comments