Commit 97e68400 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

Flake8 tests

Related to #17047898.
parent 9681f6983344
......@@ -11,8 +11,8 @@
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json
import urlparse
......@@ -21,7 +21,6 @@ import requests
from cubicweb.devtools.httptest import CubicWebServerTC
class RqlIOTC(CubicWebServerTC):
def setup_database(self):
......@@ -79,9 +78,9 @@ class RqlIOTC(CubicWebServerTC):
res = self.assertRQLPostOK(rsession, queries)
with self.admin_access.client_cnx() as cnx:
self.assertEqual('pachyderms',
cnx.execute('String N WHERE U in_group G, U login "Babar", '
'G name N').rows[0][0])
rset = cnx.execute('String N WHERE U in_group G, U login "Babar", '
'G name N')
self.assertEqual('pachyderms', rset.rows[0][0])
output = [x for x, in res.json()]
self.assertEqual(1, len(output[0]))
self.assertEqual(1, len(output[1]))
......@@ -101,17 +100,17 @@ class RqlIOTC(CubicWebServerTC):
queries_ko = [(rql1, {'l': 'doesnotexist'}),
(rql2, args2)]
self.assertRQLPostKO(rsession, queries_ko,
"__r0 references empty result set")
"__r0 references empty result set")
# check ko (2)
queries_ko = [('Any U WHERE U is CWUser', None),
(rql2, args2)]
self.assertRQLPostKO(rsession, queries_ko,
"__r0 references multi lines result set")
"__r0 references multi lines result set")
# check ko (3)
queries_ko = [('Any U,L WHERE U login L, U login %(l)s',
{'l': 'toto'}), (rql2, args2)]
self.assertRQLPostKO(rsession, queries_ko,
"__r0 references multi column result set")
"__r0 references multi column result set")
if __name__ == '__main__':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment