Example #1
0
class DomainMemoryStorageTestCase(unittest.TestCase, ExpirableStorageTestMixin):
    """
    Тест на L{spamfighter.core.storage.memory.DomainMemoryStorage}.
    """

    def setUp(self):
        ExpirableStorageTestMixin.setUp(self)
        self.s = DomainMemoryStorage()
        self.s.bind(getDefaultDomain(), 'testMemory')

    def testInterface(self):
        ziv.verifyClass(IExpirableStorage, DomainMemoryStorage)
        ziv.verifyClass(IUnreliableStorage, DomainMemoryStorage)
        ziv.verifyClass(IDomainBindable, DomainMemoryStorage)

    def testPickling(self):
        import pickle

        s2 = pickle.loads(pickle.dumps(self.s))
Example #2
0
 def setUp(self):
     ExpirableStorageTestMixin.setUp(self)
     self.s = DomainMemoryStorage()
     self.s.bind(getDefaultDomain(), 'testMemory')