File tree 2 files changed +32
-1
lines changed
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ def parse_whl_metadata(contents):
52
52
"version" : "" ,
53
53
}
54
54
for line in contents .strip ().split ("\n " ):
55
- if not line . strip () :
55
+ if not line :
56
56
# Stop parsing on first empty line, which marks the end of the
57
57
# headers containing the metadata.
58
58
break
Original file line number Diff line number Diff line change @@ -140,6 +140,37 @@ Requires-Dist: this will be ignored
140
140
141
141
_tests .append (_test_parse_metadata_all )
142
142
143
+ def _test_parse_metadata_multiline_license (env ):
144
+ got = _parse_whl_metadata (
145
+ env ,
146
+ # NOTE: The trailing whitespace here is meaningful as an empty line
147
+ # denotes the end of the header.
148
+ contents = """\
149
+ Name: foo
150
+ Version: 0.0.1
151
+ License: some License
152
+
153
+ some line
154
+
155
+ another line
156
+
157
+ Requires-Dist: bar; extra == "all"
158
+ Provides-Extra: all
159
+
160
+ Requires-Dist: this will be ignored
161
+ """ ,
162
+ )
163
+ got .name ().equals ("foo" )
164
+ got .version ().equals ("0.0.1" )
165
+ got .requires_dist ().contains_exactly ([
166
+ "bar; extra == \" all\" " ,
167
+ ])
168
+ got .provides_extra ().contains_exactly ([
169
+ "all" ,
170
+ ])
171
+
172
+ _tests .append (_test_parse_metadata_multiline_license )
173
+
143
174
def whl_metadata_test_suite (name ): # buildifier: disable=function-docstring
144
175
test_suite (
145
176
name = name ,
You can’t perform that action at this time.
0 commit comments