Change in python/osmo-python-tests[master]: osmo_interact/common: ignore trailing empty lines in received results

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Sep 10 13:54:49 UTC 2018


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10866


Change subject: osmo_interact/common: ignore trailing empty lines in received results
......................................................................

osmo_interact/common: ignore trailing empty lines in received results

If the VTY/CTRL output contains trailing newlines, do not cause those to
trigger mismatch errors, rather drop those.

Rationale: in transcript scripts, the amount of empty lines between expected
results is ignored, to allow cosmetically arranging into sections. So trailing
newlines are dropped, and there is no way to preserve those.

Change-Id: I1930868451c5738b17e318a9807590d948210b9a
---
M osmopy/osmo_interact/common.py
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/66/10866/1

diff --git a/osmopy/osmo_interact/common.py b/osmopy/osmo_interact/common.py
index 31f44a8..349051e 100644
--- a/osmopy/osmo_interact/common.py
+++ b/osmopy/osmo_interact/common.py
@@ -268,6 +268,10 @@
             e += 1
             g += 1
 
+        # ignore final empty lines, we also strip empty lines from the expected string
+        while g < len(got) and not got[g]:
+            g += 1
+
         if g < len(got):
             return 'Did not expect line %r' % got[g]
         return True

-- 
To view, visit https://gerrit.osmocom.org/10866
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1930868451c5738b17e318a9807590d948210b9a
Gerrit-Change-Number: 10866
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180910/d9b713a5/attachment.htm>


More information about the gerrit-log mailing list