summaryrefslogtreecommitdiff
path: root/tests/testsentinel.py
diff options
context:
space:
mode:
authorfuzzyman <devnull@localhost>2009-06-22 17:47:18 +0000
committerfuzzyman <devnull@localhost>2009-06-22 17:47:18 +0000
commit812169621f31e45830c669af01ab14c09842c4ec (patch)
tree9fc0f301dbe148654c78cfc46bf00b6ab4a5e7f5 /tests/testsentinel.py
parentc93e07100220ccbc85fb868bfb07eda216242dff (diff)
downloadmock-812169621f31e45830c669af01ab14c09842c4ec.tar.gz
renaming test modules to be compatible with discovery.
Diffstat (limited to 'tests/testsentinel.py')
-rw-r--r--tests/testsentinel.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/testsentinel.py b/tests/testsentinel.py
new file mode 100644
index 0000000..5ecdb88
--- /dev/null
+++ b/tests/testsentinel.py
@@ -0,0 +1,34 @@
+# Copyright (C) 2007-2009 Michael Foord
+# E-mail: fuzzyman AT voidspace DOT org DOT uk
+# http://www.voidspace.org.uk/python/mock/
+
+import os
+import sys
+this_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
+if not this_dir in sys.path:
+ sys.path.insert(0, this_dir)
+
+from testcase import TestCase
+from testutils import RunTests
+
+from mock import sentinel, DEFAULT
+
+
+class SentinelTest(TestCase):
+
+ def testSentinels(self):
+ self.assertEquals(sentinel.whatever, sentinel.whatever, 'sentinel not stored')
+ self.assertNotEquals(sentinel.whatever, sentinel.whateverelse, 'sentinel should be unique')
+
+
+ def testSentinelName(self):
+ self.assertEquals(str(sentinel.whatever), '<SentinelObject "whatever">', 'sentinel name incorrect')
+
+
+ def testDEFAULT(self):
+ self.assertTrue(DEFAULT is sentinel.DEFAULT)
+
+
+
+if __name__ == '__main__':
+ RunTests(SentinelTest)