# HG changeset patch
# User Teemu Piippo <teemu@hecknology.net>
# Date 1561327597 -10800
# Node ID b25fc6f7eb70b70e98bf2e17e85f6946b4ed8706
# Parent  4438502fd3e02133fd9fdc9df8814e030f494485
added tests for missing license and non-CA

diff -r 4438502fd3e0 -r b25fc6f7eb70 tests/misc.py
--- a/tests/misc.py	Mon Jun 24 01:01:45 2019 +0300
+++ b/tests/misc.py	Mon Jun 24 01:06:37 2019 +0300
@@ -46,14 +46,33 @@
     severity = 'hold',
     message = lambda reason: str.format('bad header: {}', reason),
 )
+@problem_type('no-license-set',
+    severity = 'hold',
+    message = 'no license set',
+)
+@problem_type('non-ca-license',
+    severity = 'hold',
+    message = 'no new non-CA-submits are accepted',
+)
 def bad_header(model):
     import header
+    ca_license = 'Redistributable under CCAL version 2.0 : see CAreadme.txt'
     if isinstance(model.header, header.BadHeader):
         yield report_problem(
             'bad-header',
             bad_object = model.body[model.header.index],
             reason = model.header.reason,
         )
+    elif not model.header.license:
+        yield report_problem(
+            'no-license-set',
+            bad_object = model.body[0],
+        )
+    elif model.header.license != ca_license:
+        yield report_problem(
+            'non-ca-license',
+            bad_object = model.find_first_header_object('license'),
+        )
 
 @problem_type('bfc-nocertify',
     severity = 'hold',