@@ -33,35 +33,35 @@ def test_field_multi_valued_basics() -> None:
3333 assert field .name == "fname"
3434 assert field .kind == FieldPosition .HEADER
3535 assert field .value == ["fval1" , "fval2" ]
36- assert field .get_value () == "fval1,fval2"
36+ assert field .get_value () == "fval1, fval2"
3737 assert field .get_value_list () == ["fval1" , "fval2" ]
3838
3939
4040@pytest .mark .parametrize (
4141 "values,expected" ,
4242 [
4343 (["val1" ], "val1" ),
44- (["val1" , "val2" ], "val1,val2" ),
45- (["©väl" , "val2" ], "©väl,val2" ),
44+ (["val1" , "val2" ], "val1, val2" ),
45+ (["©väl" , "val2" ], "©väl, val2" ),
4646 # Values containing commas must be double-quoted.
47- (["val1," , "val2" ], '"val1,",val2' ),
48- (["v,a,l,1" , "val2" ], '"v,a,l,1",val2' ),
47+ (["val1," , "val2" ], '"val1,", val2' ),
48+ (["v,a,l,1" , "val2" ], '"v,a,l,1", val2' ),
4949 # ... but if the value is already quoted, it will not be quoted again.
50- (['"v,a,l,1"' , "val2" ], '"v,a,l,1",val2' ),
50+ (['"v,a,l,1"' , "val2" ], '"v,a,l,1", val2' ),
5151 # In strings the got quoted, pre-existing double quotes are escaped with a
5252 # single backslash. The second backslash below is for escaping the actual
5353 # backslash in the string for Python.
54- (["slc" , '4,196"' ], 'slc,"4,196\\ ""' ),
54+ (["slc" , '4,196"' ], 'slc, "4,196\\ ""' ),
5555 # ... unless they appear at the beginning AND end of the value, i.e. the value
5656 # is already quoted.
57- (['"quoted"' , "val2" ], '"quoted",val2' ),
57+ (['"quoted"' , "val2" ], '"quoted", val2' ),
5858 # If the value is already quoted, additional quotes contained within do not get
5959 # escaped.
60- (['"""' , "val2" ], '""",val2' ),
60+ (['"""' , "val2" ], '""", val2' ),
6161 # Backslashes are also escaped. The following case is a single backslash getting
6262 # serialized into two backslashes. Python escaping accounts for each actual
6363 # backslash being written as two.
64- (["foo,bar\\ " , "val2" ], '"foo,bar\\ \\ ",val2' ),
64+ (["foo,bar\\ " , "val2" ], '"foo,bar\\ \\ ", val2' ),
6565 ],
6666)
6767def test_field_serialization (values , expected ):
0 commit comments