@@ -104,11 +104,11 @@ def test_core_search_no_args(run_command, httpserver):
104104 num_platforms = 0
105105 lines = [l .strip ().split () for l in result .stdout .strip ().splitlines ()]
106106 # Index update output and the header are printed on the first lines
107- assert ["Updating" , "index:" , "package_index.json" , "downloaded" ] in lines [: 6 ]
108- assert ["Updating" , "index:" , "package_index.json.sig" , "downloaded" ] in lines [: 6 ]
109- assert ["ID " , "Version " , "Name " ] == lines [ 5 ]
110- assert [ "test:x86 " , "2.0.0 " , "test_core" ] in lines [ 6 :]
111- num_platforms = len (lines [6 :])
107+ assert ["Updating" , "index:" , "package_index.json" , "downloaded" ] in lines
108+ assert ["Updating" , "index:" , "package_index.json.sig" , "downloaded" ] in lines
109+ assert ["test:x86 " , "2.0.0 " , "test_core " ] in lines
110+ header_index = lines . index ([ "ID " , "Version " , "Name" ])
111+ num_platforms = len (lines [header_index + 1 :])
112112
113113 # same thing in JSON format, also check the number of platforms found is the same
114114 result = run_command ("core search --format json" )
@@ -123,11 +123,11 @@ def test_core_search_no_args(run_command, httpserver):
123123 num_platforms = 0
124124 lines = [l .strip ().split () for l in result .stdout .strip ().splitlines ()]
125125 # Index update output and the header are printed on the first lines
126- assert ["Updating" , "index:" , "package_index.json" , "downloaded" ] in lines [: 9 ]
127- assert ["Updating" , "index:" , "package_index.json.sig" , "downloaded" ] in lines [: 9 ]
128- assert ["ID " , "Version " , "Name " ] == lines [ 8 ]
129- assert [ "test:x86 " , "2.0.0 " , "test_core" ] in lines [ 9 :]
130- num_platforms = len (lines [9 :])
126+ assert ["Updating" , "index:" , "package_index.json" , "downloaded" ] in lines
127+ assert ["Updating" , "index:" , "package_index.json.sig" , "downloaded" ] in lines
128+ assert ["test:x86 " , "2.0.0 " , "test_core " ] in lines
129+ header_index = lines . index ([ "ID " , "Version " , "Name" ])
130+ num_platforms = len (lines [header_index + 1 :])
131131
132132 # same thing in JSON format, also check the number of platforms found is the same
133133 result = run_command (f"core search --format json --additional-urls={ url } " )
0 commit comments