summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjason kirtland <jek@discorporate.us>2010-07-20 19:00:25 +0100
committerjason kirtland <jek@discorporate.us>2010-07-20 19:00:25 +0100
commit6b57dccd11923a094101e178f6033b0a46c52c10 (patch)
tree501182d310b6f51526a180a60dc340f701886fb1 /tests
parentc8853255642f9620d2208e5300fdc682067ba1a6 (diff)
downloadblinker-6b57dccd11923a094101e178f6033b0a46c52c10.tar.gz
Renamed 'temporarily_connected_to' to simply 'connected_to'.
Old spelling will be deprecated in 1.2 and removed in the release after.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_context.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/test_context.py b/tests/test_context.py
index b5de372..6a9afcd 100644
--- a/tests/test_context.py
+++ b/tests/test_context.py
@@ -10,6 +10,21 @@ def test_temp_connection():
receiver = lambda sender: canary.append(sender)
sig.send(1)
+ with sig.connected_to(receiver):
+ sig.send(2)
+ sig.send(3)
+
+ assert canary == [2]
+ assert not sig.receivers
+
+
+def test_temp_connection_alias():
+ sig = Signal()
+
+ canary = []
+ receiver = lambda sender: canary.append(sender)
+
+ sig.send(1)
with sig.temporarily_connected_to(receiver):
sig.send(2)
sig.send(3)
@@ -24,7 +39,7 @@ def test_temp_connection_for_sender():
canary = []
receiver = lambda sender: canary.append(sender)
- with sig.temporarily_connected_to(receiver, sender=2):
+ with sig.connected_to(receiver, sender=2):
sig.send(1)
sig.send(2)
@@ -43,7 +58,7 @@ def test_temp_connection_failure():
try:
sig.send(1)
- with sig.temporarily_connected_to(receiver):
+ with sig.connected_to(receiver):
sig.send(2)
raise Failure
sig.send(3)