~ubuntu-branches/ubuntu/trusty/python-axiom/trusty

« back to all changes in this revision

Viewing changes to axiom/test/test_batch.py

  • Committer: Bazaar Package Importer
  • Author(s): Debian Python Modules Team, Sandro Tosi, Vincent Bernat
  • Date: 2010-01-13 20:38:50 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100113203850-v552yecly7l65dtd
Tags: 0.6.0-1
[ Sandro Tosi ]
* debian/rules
  - don't FTBFS when removing not-existing dirs; thanks to Lucas Nussbaum for
    the report; Closes: #560565

[ Vincent Bernat ]
* New upstream release.
* debian/control
  - don't use obsolete "<" for Conflicts field; use "<<" instead. Closes: #557926.
  - bump Standards-Version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
from twisted.trial import unittest
3
 
from twisted.python import log, failure, filepath
 
3
from twisted.python import failure, filepath
4
4
from twisted.application import service
5
5
 
6
6
from axiom import iaxiom, store, item, attributes, batch, substore
7
 
from axiom.scheduler import Scheduler
8
 
 
9
 
from axiom.dependency import installOn
10
7
 
11
8
class TestWorkUnit(item.Item):
12
9
    information = attributes.integer()
41
38
    def setUp(self):
42
39
        self.procType = batch.processor(TestWorkUnit)
43
40
        self.store = store.Store()
44
 
        self.scheduler = Scheduler(store=self.store)
45
 
        installOn(self.scheduler, self.store)
 
41
        self.scheduler = iaxiom.IScheduler(self.store)
46
42
 
47
43
 
48
44
    def testItemTypeCreation(self):
230
226
        self.assertEquals(errors[0][0], listener)
231
227
        self.assertEquals(errors[0][1].information, 1)
232
228
 
233
 
        loggedErrors = log.flushErrors(RuntimeError)
 
229
        loggedErrors = self.flushLoggedErrors(RuntimeError)
234
230
        self.assertEquals(len(loggedErrors), 1)
235
231
        self.assertEquals(loggedErrors[0].getErrorMessage(), errmsg)
236
232
 
584
580
 
585
581
        dbdir = filepath.FilePath(self.mktemp())
586
582
        st = store.Store(dbdir)
587
 
        installOn(Scheduler(store=st), st)
588
583
        source = BatchWorkSource(store=st)
589
584
        for i in range(BATCH_WORK_UNITS):
590
585
            BatchWorkItem(store=st)
604
599
 
605
600
 
606
601
        self.assertEquals(
607
 
            len(log.flushErrors(BrokenException)),
 
602
            len(self.flushLoggedErrors(BrokenException)),
608
603
            BATCH_WORK_UNITS)
609
604
 
610
605
        self.assertEquals(