summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_functional.py
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-05-29 17:52:17 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-05-29 17:52:17 +0100
commit52d2a8b3119479246225f7f888c370320cf8622f (patch)
tree6d02022a0260b530021c668dde632f5feb9c09c0 /tests/utils_tests/test_functional.py
parentd0ecefc2c9114b21e5f83d534990ffc3a44b8cba (diff)
Add test for new __ne__ method on Promise.
Diffstat (limited to 'tests/utils_tests/test_functional.py')
-rw-r--r--tests/utils_tests/test_functional.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/utils_tests/test_functional.py b/tests/utils_tests/test_functional.py
index 3bb50007c6..fc2256a1f2 100644
--- a/tests/utils_tests/test_functional.py
+++ b/tests/utils_tests/test_functional.py
@@ -64,3 +64,15 @@ class FunctionalTestCase(unittest.TestCase):
# check that it behaves like a property when there's no instance
self.assertIsInstance(A.value, cached_property)
+
+ def test_lazy_equality(self):
+ """
+ Tests that == and != work correctly for Promises.
+ """
+
+ lazy_a = lazy(lambda: 4, int)
+ lazy_b = lazy(lambda: 4, int)
+ lazy_c = lazy(lambda: 5, int)
+
+ self.assertEqual(lazy_a(), lazy_b())
+ self.assertNotEqual(lazy_b(), lazy_c())