File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed
Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -277,9 +277,8 @@ def load_json(location):
277277
278278 # FIXME: this is too clever and complex... IMHO we should not try to guess the format.
279279 # instead a command line option should be provided explictly to say what is the format
280- if isinstance (results , list ):
281- results = sorted (results )
282- else :
280+ if not isinstance (results , list ):
281+ # FIXME: I think we can remove the support of aboutcode_manager
283282 if u'aboutcode_manager_notice' in results :
284283 results = results ['components' ]
285284 elif u'scancode_notice' in results :
Original file line number Diff line number Diff line change @@ -375,6 +375,21 @@ def test_load_json(self):
375375 result = util .load_json (test_file )
376376 assert expected == result
377377
378+ def test_load_json_multi_entries (self ):
379+ test_file = get_test_loc ('test_util/json/multi_entries.json' )
380+ expected = [dict ([
381+ ('about_file_path' , '/load/this.ABOUT' ),
382+ ('about_resource' , '.' ),
383+ ('name' , 'AboutCode' ),
384+ ('version' , '0.11.0' )]),
385+ dict ([
386+ ('about_file_path' , '/load/that.ABOUT' ),
387+ ('about_resource' , '.' ),
388+ ('name' , 'that' )])
389+ ]
390+ result = util .load_json (test_file )
391+ assert expected == result
392+
378393 def test_load_json2 (self ):
379394 test_file = get_test_loc ('test_util/json/expected_need_mapping.json' )
380395 expected = [dict (dict ([
Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "about_file_path" : " /load/this.ABOUT" ,
4+ "about_resource" : " ." ,
5+ "name" : " AboutCode" ,
6+ "version" : " 0.11.0"
7+ },
8+ {
9+ "about_file_path" : " /load/that.ABOUT" ,
10+ "about_resource" : " ." ,
11+ "name" : " that"
12+ }
13+ ]
You can’t perform that action at this time.
0 commit comments