@@ -104,11 +104,11 @@ def test_core_search_no_args(run_command, httpserver):
104
104
num_platforms = 0
105
105
lines = [l .strip ().split () for l in result .stdout .strip ().splitlines ()]
106
106
# 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 :])
112
112
113
113
# same thing in JSON format, also check the number of platforms found is the same
114
114
result = run_command ("core search --format json" )
@@ -123,11 +123,11 @@ def test_core_search_no_args(run_command, httpserver):
123
123
num_platforms = 0
124
124
lines = [l .strip ().split () for l in result .stdout .strip ().splitlines ()]
125
125
# 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 :])
131
131
132
132
# same thing in JSON format, also check the number of platforms found is the same
133
133
result = run_command (f"core search --format json --additional-urls={ url } " )
0 commit comments