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


 

On Fri, 15 Nov 2019, at 13:09, Paul Barker wrote:
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@...>
---
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

Ping.

--
Paul Barker

Join yocto@lists.yoctoproject.org to automatically receive all group messages.