Commit 04b0201a authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

no more .env attribute on tests

parent ccb56ede7e72
......@@ -12,7 +12,7 @@ from cubes.email.mboximport import MBOXImporter
class MBOXImporterTC(CubicWebTC):
def test_all(self):
mi = MBOXImporter(self.env.cnx)
mi = MBOXImporter(self.cnx)
mi.import_mbox_stream(open('data/mbox'))
self.assertEquals(sorted([(x, len(y)) for x, y in mi.created.items()]),
[('email', 2), ('emailaddress', 4),
......@@ -174,7 +174,7 @@ http://lists.logilab.org/mailman/listinfo/python-projects
"""
def test_no_subject(self):
mi = MBOXImporter(self.env.cnx)
mi = MBOXImporter(self.cnx)
mi.import_mbox_stream(StringIO(self.NOSUBJECT))
rset = self.execute('Any X ORDERBY S WHERE X is Email, X subject S')
self.assertEquals(len(rset), 1)
......@@ -183,7 +183,7 @@ http://lists.logilab.org/mailman/listinfo/python-projects
self.assertEquals(email.references(), set(('<xxx@blabla>',)))
def test_double_import(self):
mi = MBOXImporter(self.env.cnx)
mi = MBOXImporter(self.cnx)
mi.import_mbox_stream(StringIO(self.NOSUBJECT))
mi.import_mbox_stream(StringIO(self.NOSUBJECT))
rset = self.execute('Any X ORDERBY S WHERE X is Email, X subject S')
......@@ -203,7 +203,7 @@ http://lists.logilab.org/mailman/listinfo/python-projects
#self.assertEquals(testrset[0][0], eid2)
#testrset = cursor.execute('Any X WHERE X identical_to Y, X canonical TRUE, Y eid %(y)s', {'y': eid1})
#self.assertEquals(testrset[0][0], eid2)
mi = MBOXImporter(self.env.cnx)
mi = MBOXImporter(self.cnx)
mi.import_mbox_stream(StringIO(self.NOSUBJECT))
rset = self.execute('Any X ORDERBY S WHERE X is Email, X subject S')
self.assertEquals(len(rset), 1)
......
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