tests/misc.py

changeset 86
b25fc6f7eb70
parent 78
1970afe52da4
child 87
90105119ff90
equal deleted inserted replaced
85:4438502fd3e0 86:b25fc6f7eb70
44 44
45 @problem_type('bad-header', 45 @problem_type('bad-header',
46 severity = 'hold', 46 severity = 'hold',
47 message = lambda reason: str.format('bad header: {}', reason), 47 message = lambda reason: str.format('bad header: {}', reason),
48 ) 48 )
49 @problem_type('no-license-set',
50 severity = 'hold',
51 message = 'no license set',
52 )
53 @problem_type('non-ca-license',
54 severity = 'hold',
55 message = 'no new non-CA-submits are accepted',
56 )
49 def bad_header(model): 57 def bad_header(model):
50 import header 58 import header
59 ca_license = 'Redistributable under CCAL version 2.0 : see CAreadme.txt'
51 if isinstance(model.header, header.BadHeader): 60 if isinstance(model.header, header.BadHeader):
52 yield report_problem( 61 yield report_problem(
53 'bad-header', 62 'bad-header',
54 bad_object = model.body[model.header.index], 63 bad_object = model.body[model.header.index],
55 reason = model.header.reason, 64 reason = model.header.reason,
65 )
66 elif not model.header.license:
67 yield report_problem(
68 'no-license-set',
69 bad_object = model.body[0],
70 )
71 elif model.header.license != ca_license:
72 yield report_problem(
73 'non-ca-license',
74 bad_object = model.find_first_header_object('license'),
56 ) 75 )
57 76
58 @problem_type('bfc-nocertify', 77 @problem_type('bfc-nocertify',
59 severity = 'hold', 78 severity = 'hold',
60 message = 'all new parts must be BFC certified', 79 message = 'all new parts must be BFC certified',

mercurial