Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 # Copyright (C) 2007-2012 Michael Foord & the mock team
2 # E-mail: fuzzyman AT voidspace DOT org DOT uk
3 # http://www.voidspace.org.uk/python/mock/
5 from tests.support import unittest2
7 from mock import sentinel, DEFAULT
10 class SentinelTest(unittest2.TestCase):
12 def testSentinels(self):
13 self.assertEqual(sentinel.whatever, sentinel.whatever,
14 'sentinel not stored')
15 self.assertNotEqual(sentinel.whatever, sentinel.whateverelse,
16 'sentinel should be unique')
19 def testSentinelName(self):
20 self.assertEqual(str(sentinel.whatever), 'sentinel.whatever',
21 'sentinel name incorrect')
24 def testDEFAULT(self):
25 self.assertTrue(DEFAULT is sentinel.DEFAULT)
27 def testBases(self):
28 # If this doesn't raise an AttributeError then help(mock) is broken
29 self.assertRaises(AttributeError, lambda: sentinel.__bases__)
32 if __name__ == '__main__':
33 unittest2.main()