summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2019-05-27 18:50:39 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2019-06-02 14:44:13 +0100
commite9f5ff1dde0e28bbdf2b5919af1ac3bf646866f4 (patch)
tree87244d5c6d6ccccaa24195cd4147dedac4c3fac6 /tests
parent7a68d4d2cac3f12395696a6eaadce449fa336f52 (diff)
tests: move test for utils.ensure_unique_address
Diffstat (limited to 'tests')
-rw-r--r--tests/commands/test_thread.py25
-rw-r--r--tests/db/test_utils.py27
2 files changed, 27 insertions, 25 deletions
diff --git a/tests/commands/test_thread.py b/tests/commands/test_thread.py
index 634c35e8..46d20ac7 100644
--- a/tests/commands/test_thread.py
+++ b/tests/commands/test_thread.py
@@ -20,31 +20,6 @@ from alot.account import Account
# pylint: disable=blacklisted-name
-class Test_ensure_unique_address(unittest.TestCase):
-
- foo = 'foo <foo@example.com>'
- foo2 = 'foo the fanzy <foo@example.com>'
- bar = 'bar <bar@example.com>'
- baz = 'baz <baz@example.com>'
-
- def test_unique_lists_are_unchanged(self):
- expected = sorted([self.foo, self.bar])
- actual = thread.ReplyCommand.ensure_unique_address(expected)
- self.assertListEqual(actual, expected)
-
- def test_equal_entries_are_detected(self):
- actual = thread.ReplyCommand.ensure_unique_address(
- [self.foo, self.bar, self.foo])
- expected = sorted([self.foo, self.bar])
- self.assertListEqual(actual, expected)
-
- def test_same_address_with_different_name_is_detected(self):
- actual = thread.ReplyCommand.ensure_unique_address(
- [self.foo, self.foo2])
- expected = [self.foo2]
- self.assertListEqual(actual, expected)
-
-
class _AccountTestClass(Account):
"""Implements stubs for ABC methods."""
diff --git a/tests/db/test_utils.py b/tests/db/test_utils.py
index 1e230aef..a27bee51 100644
--- a/tests/db/test_utils.py
+++ b/tests/db/test_utils.py
@@ -777,3 +777,30 @@ class TestRemoveCte(unittest.TestCase):
logmsg = 'DEBUG:root:failed to interpret Content-Transfer-Encoding: '\
'"normal"'
self.assertIn(logmsg, cm.output)
+
+
+class Test_ensure_unique_address(unittest.TestCase):
+
+ foo = 'foo <foo@example.com>'
+ foo2 = 'foo the fanzy <foo@example.com>'
+ bar = 'bar <bar@example.com>'
+ baz = 'baz <baz@example.com>'
+
+ def test_unique_lists_are_unchanged(self):
+ expected = sorted([self.foo, self.bar])
+ actual = utils.ensure_unique_address(expected)
+ self.assertListEqual(actual, expected)
+
+ def test_equal_entries_are_detected(self):
+ actual = utils.ensure_unique_address(
+ [self.foo, self.bar, self.foo])
+ expected = sorted([self.foo, self.bar])
+ self.assertListEqual(actual, expected)
+
+ def test_same_address_with_different_name_is_detected(self):
+ actual = utils.ensure_unique_address(
+ [self.foo, self.foo2])
+ expected = [self.foo2]
+ self.assertListEqual(actual, expected)
+
+