# Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ import unittest2 as unittest from mock import sentinel, DEFAULT class SentinelTest(unittest.TestCase): def testSentinels(self): self.assertEqual(sentinel.whatever, sentinel.whatever, 'sentinel not stored') self.assertNotEqual(sentinel.whatever, sentinel.whateverelse, 'sentinel should be unique') def testSentinelName(self): self.assertEqual(str(sentinel.whatever), 'sentinel.whatever', 'sentinel name incorrect') def testDEFAULT(self): self.assertIs(DEFAULT, sentinel.DEFAULT) def testBases(self): # If this doesn't raise an AttributeError then help(mock) is broken self.assertRaises(AttributeError, lambda: sentinel.__bases__) if __name__ == '__main__': unittest.main()
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 146 B | 0644 |
|
__main__.py | File | 623 B | 0644 |
|
support.py | File | 552 B | 0644 |
|
testcallable.py | File | 4.33 KB | 0644 |
|
testhelpers.py | File | 28.02 KB | 0644 |
|
testmagicmethods.py | File | 16 KB | 0644 |
|
testmock.py | File | 49.29 KB | 0644 |
|
testpatch.py | File | 55.03 KB | 0644 |
|
testsentinel.py | File | 976 B | 0644 |
|
testwith.py | File | 10.34 KB | 0644 |
|