# 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/fromtests.supportimportunittest2frommockimportsentinel,DEFAULTclassSentinelTest(unittest2.TestCase):deftestSentinels(self):self.assertEqual(sentinel.whatever,sentinel.whatever,'sentinel not stored')self.assertNotEqual(sentinel.whatever,sentinel.whateverelse,'sentinel should be unique')deftestSentinelName(self):self.assertEqual(str(sentinel.whatever),'sentinel.whatever','sentinel name incorrect')deftestDEFAULT(self):self.assertTrue(DEFAULTissentinel.DEFAULT)deftestBases(self):# If this doesn't raise an AttributeError then help(mock) is brokenself.assertRaises(AttributeError,lambda:sentinel.__bases__)if__name__=='__main__':unittest2.main()