File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -640,6 +640,23 @@ def test_with_hash(self):
640
640
'key4' : [1 , 2 , 3 , 'a mixed list#' ]
641
641
}
642
642
643
+ def test_empty_value (self ):
644
+ cfg = ConfigObj (['k = ' ], unrepr = True )
645
+ assert cfg == {'k' : '' }
646
+
647
+ def test_unclosed_quote (self ):
648
+ with pytest .raises (co .UnreprError ) as excinfo :
649
+ ConfigObj (['k = "' ], unrepr = True )
650
+ assert str (excinfo .value ) == (
651
+ "Parse error from unrepr-ing value at line 1." )
652
+
653
+ def test_multiline_string_empty (self ):
654
+ config = ['k = """' , '"""' ]
655
+ with pytest .raises (co .UnreprError ) as excinfo :
656
+ ConfigObj (config , unrepr = True )
657
+ assert str (excinfo .value ) == (
658
+ "Parse error from unrepr-ing multiline value at line 2." )
659
+
643
660
644
661
class TestValueErrors (object ):
645
662
def test_bool (self , empty_cfg ):
You can’t perform that action at this time.
0 commit comments