Created
September 28, 2012 05:18
-
-
Save sumeet/3798054 to your computer and use it in GitHub Desktop.
add test for accessing let through the class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 0e4888f0e49557cdf36e38a91a74f462a1206fc4 | |
Author: Sumeet Agarwal <sumeet.a@gmail.com> | |
Date: Thu Sep 27 22:05:22 2012 -0700 | |
add test for accessing let through the class | |
diff --git a/test/test_case_test.py b/test/test_case_test.py | |
index 66f6fd3..2bd2875 100644 | |
--- a/test/test_case_test.py | |
+++ b/test/test_case_test.py | |
@@ -2,6 +2,7 @@ import itertools | |
import unittest | |
from testify import assert_equal | |
+from testify import assert_isinstance | |
from testify import class_setup | |
from testify import class_setup_teardown | |
from testify import class_teardown | |
@@ -495,6 +496,10 @@ class LetTest(TestCase): | |
assert_equal(self.counter.next(), 0) | |
assert_equal(self.counter.next(), 1) | |
+ def test_returns_itself_when_accessed_through_the_class(self): | |
+ assert_isinstance(type(self).counter, let) | |
+ | |
+ | |
class LetWithLambdaTest(TestCase): | |
counter = let(lambda self: itertools.count(0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment