summaryrefslogtreecommitdiff
path: root/tests/test_utilities.py
diff options
context:
space:
mode:
authorjason kirtland <jek@discorporate.us>2010-02-14 09:40:29 -0800
committerjason kirtland <jek@discorporate.us>2010-02-14 09:40:29 -0800
commitc2d9461914c3624b49b596e3bd5d76dc32b406d1 (patch)
treef55897d79213aa56d9eec2444b701dac685d6f58 /tests/test_utilities.py
downloadblinker-c2d9461914c3624b49b596e3bd5d76dc32b406d1.tar.gz
Initial import from flatland.util.signals
Diffstat (limited to 'tests/test_utilities.py')
-rw-r--r--tests/test_utilities.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_utilities.py b/tests/test_utilities.py
new file mode 100644
index 0000000..4f802f4
--- /dev/null
+++ b/tests/test_utilities.py
@@ -0,0 +1,24 @@
+import pickle
+
+from blinker._utilities import symbol
+
+
+def test_symbols():
+ foo = symbol('foo')
+ assert foo.name == 'foo'
+ assert foo is symbol('foo')
+
+ bar = symbol('bar')
+ assert foo is not bar
+ assert foo != bar
+ assert not foo == bar
+
+ assert repr(foo) == 'foo'
+
+
+def test_pickled_symbols():
+ foo = symbol('foo')
+
+ for protocol in 0, 1, 2:
+ roundtrip = pickle.loads(pickle.dumps(foo))
+ assert roundtrip is foo