~divmod-dev/divmod.org/combinator-wants-user-site-packages-3002

« back to all changes in this revision

Viewing changes to Quotient/xquotient/test/historic/test_filter3to4.py

  • Committer: exarkun
  • Date: 2009-07-16 00:52:55 UTC
  • Revision ID: svn-v4:866e43f7-fbfc-0310-8f2a-ec88d1da2979:trunk:17773
Merge quotient-scheduler-2925

Author: exarkun
Reviewer: mithrandi
Fixes: #2925

Remove all code from Quotient which instantiates Schedulers or SubSchedulers and
upgrade away persistent attributes which refer to existing such items.  Replace
this with simple adaption of Stores to IScheduler where necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
"""
 
3
Tests for L{Filter} schema upgrading.
 
4
"""
 
5
 
 
6
from axiom.test.historic.stubloader import StubbedTest
 
7
 
 
8
from xquotient.spam import Filter
 
9
from xquotient.mail import MessageSource
 
10
from xquotient.exmess import _TrainingInstructionSource
 
11
 
 
12
from xquotient.test.historic.stub_filter3to4 import USE_POSTINI_SCORE, POSTINI_THRESHHOLD
 
13
 
 
14
 
 
15
class FilterUpgradeTest(StubbedTest):
 
16
    """
 
17
    Tests for L{Filter} schema upgrading.
 
18
    """
 
19
    def test_attributes(self):
 
20
        """
 
21
        The upgrade preserves the values of all the remaining attributes.
 
22
        """
 
23
        filter = self.store.findUnique(Filter)
 
24
        self.assertEquals(filter.usePostiniScore, USE_POSTINI_SCORE)
 
25
        self.assertEquals(filter.postiniThreshhold, POSTINI_THRESHHOLD)
 
26
        self.assertTrue(isinstance(filter.messageSource, MessageSource))
 
27
        self.assertTrue(isinstance(filter.tiSource, _TrainingInstructionSource))
 
28