From bd5b1f207d24043b918433aaa3f00e499a4ceca2 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Tue, 29 Mar 2016 21:02:54 +0200 Subject: [PATCH] fix lint --- tests/integration/quteprocess.py | 15 ++++++++------- tests/integration/test_quteprocess.py | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/integration/quteprocess.py b/tests/integration/quteprocess.py index e3f7ec882..6154cfa5f 100644 --- a/tests/integration/quteprocess.py +++ b/tests/integration/quteprocess.py @@ -259,7 +259,8 @@ class QuteProc(testprocess.Process): Return: The LogLine. """ - return self.wait_for(category='js', function='javaScriptConsoleMessage', + return self.wait_for(category='js', + function='javaScriptConsoleMessage', message='[*] {}'.format(message)) def _is_error_logline(self, msg): @@ -429,8 +430,8 @@ class QuteProc(testprocess.Process): def click_element(self, text): """Click the element with the given text.""" - # Use Javascript and XPath to find the right element, use console.log to - # return an error (no element found, ambiguous element) + # Use Javascript and XPath to find the right element, use console.log + # to return an error (no element found, ambiguous element) script = ( 'var _es = document.evaluate(\'//*[text()={text}]\', document, ' 'null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);' @@ -469,12 +470,12 @@ def _xpath_escape(text): The string "escaped" as a concat() call. """ # Shortcut if at most a single quoting style is used - if not "'" in text or not '"' in text: + if "'" not in text or '"' not in text: return repr(text) parts = re.split('([\'"])', text) - # Python's repr() of strings will automatically choose the right quote type. - # Since each part only contains one "type" of quote, no escaping should be - # necessary. + # Python's repr() of strings will automatically choose the right quote + # type. Since each part only contains one "type" of quote, no escaping + # should be necessary. parts = [repr(part) for part in parts if part] return 'concat({})'.format(', '.join(parts)) diff --git a/tests/integration/test_quteprocess.py b/tests/integration/test_quteprocess.py index 4cf537a71..7698e1a07 100644 --- a/tests/integration/test_quteprocess.py +++ b/tests/integration/test_quteprocess.py @@ -190,7 +190,8 @@ class TestClickElement: ('Test', "'Test'"), ("Don't", '"Don\'t"'), # This is some serious string escaping madness - ('"Don\'t", he said', "concat('\"', 'Don', \"'\", 't', '\"', ', he said')"), + ('"Don\'t", he said', + "concat('\"', 'Don', \"'\", 't', '\"', ', he said')"), ]) def test_xpath_escape(string, expected): assert quteprocess._xpath_escape(string) == expected