Francesco Romani has uploaded a new change for review.

Change subject: tests: forbid tabs in schema
......................................................................

tests: forbid tabs in schema

Our schema parser doesn't like tabs.
Add a test to detect them, to avoid wasting times
chasing them in the editor.

Change-Id: I1689726cf8c598351948c9038ed91366cbbe4ee3
Signed-off-by: Francesco Romani <from...@redhat.com>
---
M tests/schemaValidationTest.py
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/97/37697/1

diff --git a/tests/schemaValidationTest.py b/tests/schemaValidationTest.py
index cbadf9a..b7fa06d 100644
--- a/tests/schemaValidationTest.py
+++ b/tests/schemaValidationTest.py
@@ -58,6 +58,18 @@
                     raise AssertionError('Lines longer than 80\n%s'
                                          % '\n'.join(longer))
 
+    def test_tabs_in_line(self):
+        for fname in self._get_paths():
+            with open(fname) as f:
+                with_tabs = []
+                for i, line in enumerate(f):
+                    if '\t' in line:
+                        with_tabs.append('line [%d] %s' % (i + 1, line))
+
+                if len(with_tabs) > 0:
+                    raise AssertionError('Lines containing tabs\n%s'
+                                         % '\n'.join(with_tabs))
+
     def _get_paths(self):
         testPath = os.path.realpath(__file__)
         dirName = os.path.split(testPath)[0]


-- 
To view, visit http://gerrit.ovirt.org/37697
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1689726cf8c598351948c9038ed91366cbbe4ee3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to