Project

General

Profile

« Previous | Next » 

Revision 8a036bc7

Added by koszko over 1 year ago

add test case with modified index.json from the example

View differences:

src/hydrilla_builder/build.py
223 223

  
224 224
        index_obj = json.loads(strip_json_comments(index_json_text))
225 225

  
226
        self.files_by_path[self.index_json_path] = \
227
            FileRef(self.index_json_path, index_json_text.encode())
226
        self.files_by_path[self.srcdir / 'index.json'] = \
227
            FileRef(self.srcdir / 'index.json', index_json_text.encode())
228 228

  
229 229
        self._process_index_json(index_obj)
230 230

  
......
302 302
        """
303 303
        copy_props = ['type', 'identifier', 'long_name', 'uuid', 'description']
304 304
        if 'comment' in item_def:
305
            copy_props.append(copy_props)
305
            copy_props.append('comment')
306 306

  
307 307
        if item_def['type'] == 'resource':
308 308
            item_list = self.resource_list
......
319 319
        else:
320 320
            item_list = self.mapping_list
321 321

  
322
            payloads = dict([(pat, {'identifier': res_ref['identifier']})
323
                             for pat, res_ref in item_def['payloads'].items()])
322
            payloads = {}
323
            for pat, res_ref in item_def.get('payloads', {}).items():
324
                payloads[pat] = {'identifier': res_ref['identifier']}
324 325

  
325 326
            new_item_obj = {
326 327
                'payloads': payloads
......
386 387
            'source_archives':    source_archives_obj
387 388
        }
388 389

  
390
        if 'comment' in index_obj:
391
            self.source_description['comment'] = index_obj['comment']
392

  
389 393
    def write_source_package_zip(self, dstpath: Path):
390 394
        """
391 395
        Create a .zip archive containing files needed to build this source

Also available in: Unified diff