Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Anti-censorship
BridgeDB
Commits
6a7d9d6d
Unverified
Commit
6a7d9d6d
authored
Jul 07, 2014
by
Isis Lovecruft
Browse files
Add unittest for SMTPAutoresponder.runChecks() with blacklisted email.
parent
387115d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/bridgedb/test/email_helpers.py
View file @
6a7d9d6d
...
...
@@ -38,7 +38,7 @@ EMAIL_DOMAIN_RULES = {
}
EMAIL_DOMAINS
=
[
"gmail.com"
,
"example.com"
,
"localhost"
]
EMAIL_WHITELIST
=
{
'white@list.ed'
:
'ABCD1234ABCD1234ABCD1234ABCD1234ABCD1234'
}
EMAIL_BLACKLIST
=
[
'feidanchaoren'
]
EMAIL_BLACKLIST
=
[
'feidanchaoren
0001@gmail.com
'
]
EMAIL_FUZZY_MATCH
=
4
EMAIL_USERNAME
=
"bridges"
EMAIL_SMTP_HOST
=
"127.0.0.1"
...
...
lib/bridgedb/test/test_email_autoresponder.py
View file @
6a7d9d6d
...
...
@@ -562,3 +562,10 @@ class SMTPAutoresponderTests(unittest.TestCase):
self
.
message
.
lines
.
insert
(
3
,
header
)
self
.
_setUpResponder
()
self
.
assertFalse
(
self
.
responder
.
runChecks
(
emailFrom
))
def
test_SMTPAutoresponder_runChecks_blacklisted
(
self
):
"""runChecks() on an blacklisted email address should return False."""
emailFrom
=
Address
(
'feidanchaoren0043@gmail.com'
)
self
.
_getIncomingLines
(
str
(
emailFrom
))
self
.
_setUpResponder
()
self
.
assertFalse
(
self
.
responder
.
runChecks
(
emailFrom
))
Write
Preview
Supports
Markdown
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