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

Flake8 tests

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