Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
email
Commits
a974ea791929
Commit
9f849ab5
authored
Jan 17, 2011
by
Sylvain Thénault
Browse files
default is stable
--HG-- branch : stable
parents
6ace901aff57
2b46da8af305
Changes
2
Show whitespace changes
Inline
Side-by-side
test/unittest_hooks.py
View file @
a974ea79
# -*- coding: iso-8859-1 -*-
from
socket
import
gethostname
from
StringIO
import
StringIO
from
os.path
import
join
from
logilab.common.testlib
import
unittest_main
...
...
@@ -149,7 +150,7 @@ class ReplyCommentHooksTC(CubicWebTC):
def
test_comment_created
(
self
):
mi
=
MBOXImporter
(
self
.
cnx
)
msg
=
open
(
'data/
reply.mbox'
,
'rb'
).
read
()
%
\
msg
=
open
(
join
(
self
.
datadir
,
'
reply.mbox'
)
,
'rb'
).
read
()
%
\
construct_message_id
(
self
.
vreg
.
config
.
appid
,
self
.
b
.
eid
,
False
)
mi
.
import_mbox_stream
(
StringIO
(
msg
))
self
.
commit
()
...
...
test/unittest_mboximport.py
View file @
a974ea79
"""unit tests for email mbox import functionnality"""
from
StringIO
import
StringIO
from
os.path
import
join
from
logilab.common.testlib
import
TestCase
,
unittest_main
...
...
@@ -13,7 +14,7 @@ class MBOXImporterTC(CubicWebTC):
def
test_all
(
self
):
mi
=
MBOXImporter
(
self
.
cnx
)
mi
.
import_mbox_stream
(
open
(
'data/
mbox'
))
mi
.
import_mbox_stream
(
open
(
join
(
self
.
datadir
,
'
mbox'
))
)
self
.
assertEqual
(
sorted
([(
x
,
len
(
y
))
for
x
,
y
in
mi
.
created
.
items
()]),
[(
'email'
,
2
),
(
'emailaddress'
,
4
),
(
'emailpart'
,
5
),
(
'emailthread'
,
2
),
(
'file'
,
2
)])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment