symmetric relations: replace bogus rql2sql translation by a hook
The hook ensures X r Y => Y r X iff r is symmetric.
The rql-no-hook data importer receives a small amendment but note
that:
* there exist no test for it
* its actual semantics are undefined
Hence we cannot prove this hunk breaks nothing, because we cannot
prove anything.
Closes #3259713.
from StringIO import StringIO
from logilab.common.testlib import TestCase, unittest_main
from cubicweb import dataimport
class UcsvreaderTC(TestCase):
def test_empty_lines_skipped(self):
stream = StringIO('''a,b,c,d,
1,2,3,4,
,,,,
,,,,
''')
self.assertEqual([[u'a', u'b', u'c', u'd', u''],
[u'1', u'2', u'3', u'4', u''],
],
list(dataimport.ucsvreader(stream)))
stream.seek(0)
self.assertEqual([[u'a', u'b', u'c', u'd', u''],
[u'1', u'2', u'3', u'4', u''],
[u'', u'', u'', u'', u''],
[u'', u'', u'', u'', u'']
],
list(dataimport.ucsvreader(stream, skip_empty=False)))
if __name__ == '__main__':
unittest_main()