summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Hoffmann <l-m-h@web.de>2017-06-08 16:09:24 +0200
committerLucas Hoffmann <l-m-h@web.de>2017-06-08 16:19:05 +0200
commitc22802fc6a7cdd5643d55a89f38b95d149fd2650 (patch)
tree3dd347db8cedd539e17a26834e4f0c109514b96e
parent1c72a19d59c24a5621180118b779de22d2e9ea34 (diff)
Correct membership test
-rw-r--r--alot/addressbook/external.py2
-rw-r--r--tests/addressbook/external_test.py1
2 files changed, 1 insertions, 2 deletions
diff --git a/alot/addressbook/external.py b/alot/addressbook/external.py
index 6a89dd15..9de86f36 100644
--- a/alot/addressbook/external.py
+++ b/alot/addressbook/external.py
@@ -68,7 +68,7 @@ class ExternalAddressbook(AddressBook):
m = re.match(self.regex, l, self.reflags)
if m:
info = m.groupdict()
- if 'email' and 'name' in info:
+ if 'email' in info and 'name' in info:
email = info['email'].strip()
name = info['name']
res.append((name, email))
diff --git a/tests/addressbook/external_test.py b/tests/addressbook/external_test.py
index 059140a6..2211769e 100644
--- a/tests/addressbook/external_test.py
+++ b/tests/addressbook/external_test.py
@@ -53,7 +53,6 @@ class TestExternalAddressbookGetContacts(unittest.TestCase):
actual = abook.get_contacts()
self.assertListEqual(actual, [])
- @unittest.expectedFailure
def test_returns_empty_list_if_regex_has_no_email_submatches(self):
abook = external.ExternalAddressbook(
'foobar', self.regex.replace('email', 'xemail'))