~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_grabberconfiguration2to3.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{GrabberConfiguration} schema upgrading.
 
4
"""
 
5
 
 
6
from axiom.test.historic.stubloader import StubbedTest
 
7
 
 
8
from xmantissa.webapp import PrivateApplication
 
9
 
 
10
from xquotient.grabber import GrabberConfiguration
 
11
from xquotient.mail import DeliveryAgent
 
12
from xquotient.test.historic.stub_grabberconfiguration2to3 import PAUSED
 
13
 
 
14
 
 
15
class GrabberConfigurationUpgradeTests(StubbedTest):
 
16
    """
 
17
    Tests for L{GrabberConfiguration} schema upgrading.
 
18
    """
 
19
    def test_attributes(self):
 
20
        """
 
21
        The upgrade preserves the values of all the remaining attributes.
 
22
        """
 
23
        grabber = self.store.findUnique(GrabberConfiguration)
 
24
        self.assertEquals(grabber.paused, PAUSED)
 
25
        self.assertTrue(isinstance(grabber.privateApplication, PrivateApplication))
 
26
        self.assertTrue(isinstance(grabber.deliveryAgent, DeliveryAgent))