[yocto] [patchtest-oe][PATCH] test_patch_upstream_status: Be explicit about case sensitivity

Paul Barker paul at betafive.co.uk
Fri Nov 15 05:09:31 PST 2019


The case sensitivity of the checks for the "Upstream-Status" label
should match so that failure messages make sense. The checks in the
parse_upstream_status module are case sensitive and so the initial regex
check should also be made case sensitive.

A quick note about case sensitivity is added to the advice given if
"Upstream-Status" is not found.

Signed-off-by: Paul Barker <paul at betafive.co.uk>
---
 tests/test_patch_upstream_status.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_patch_upstream_status.py b/tests/test_patch_upstream_status.py
index a477dfb..ecccc58 100644
--- a/tests/test_patch_upstream_status.py
+++ b/tests/test_patch_upstream_status.py
@@ -23,7 +23,7 @@ import os
 
 class PatchUpstreamStatus(base.Base):
 
-    upstream_status_regex = re.compile("(?<=\+)Upstream.Status", re.IGNORECASE)
+    upstream_status_regex = re.compile("(?<=\+)Upstream.Status")
 
     @classmethod
     def setUpClassLocal(cls):
@@ -47,7 +47,7 @@ class PatchUpstreamStatus(base.Base):
             payload = newpatch.__str__()
             if not self.upstream_status_regex.search(payload):
                 self.fail('Added patch file is missing Upstream-Status in the header',
-                          'Add Upstream-Status: <Valid status> to the header of %s' % newpatch.path,
+                          'Add Upstream-Status: <Valid status> (case sensitive) to the header of %s' % newpatch.path,
                           data=[('Standard format', self.standard_format), ('Valid status', self.valid_status)])
             for line in payload.splitlines():
                 if self.patchmetadata_regex.match(line):
-- 
2.17.1



More information about the yocto mailing list