コード例 #1
0
 def setUp(self):
     # Grab the FakeMessageSource and hold a reference to it so its
     # in-memory attributes stick around long enough for us to make some
     # assertions about them.
     result = StubbedTest.setUp(self)
     self.messageSource = self.store.findUnique(FakeMessageSource)
     return result
コード例 #2
0
 def tearDown(self):
     d = StubbedTest.tearDown(self)
     def flushit(ign):
         from epsilon.cooperator import SchedulerStopped
         self.flushLoggedErrors(SchedulerStopped)
         return ign
     return d.addCallback(flushit)
コード例 #3
0
 def setUp(self):
     # Grab the FakeMessageSource and hold a reference to it so its
     # in-memory attributes stick around long enough for us to make some
     # assertions about them.
     result = StubbedTest.setUp(self)
     self.messageSource = self.store.findUnique(FakeMessageSource)
     return result
コード例 #4
0
    def setUp(self):
        d = StubbedTest.setUp(self)

        def cbSetUp(ignored):
            self.hook = self.store.findUnique(_SubSchedulerParentHook)

        d.addCallback(cbSetUp)
        return d
コード例 #5
0
    def setUp(self):
        D = StubbedTest.setUp(self)

        def setUpFinished():
            self.inbox = self.store.findUnique(Inbox)

        D.addCallback(lambda _: setUpFinished())
        return D
コード例 #6
0
 def setUp(self):
     """
     Skip the tests if PIL is unavailable.
     """
     try:
         import PIL
     except ImportError:
         raise SkipTest('PIL is not available')
     return StubbedTest.setUp(self)
コード例 #7
0
    def tearDown(self):
        d = StubbedTest.tearDown(self)

        def flushit(ign):
            from epsilon.cooperator import SchedulerStopped
            self.flushLoggedErrors(SchedulerStopped)
            return ign

        return d.addCallback(flushit)
コード例 #8
0
ファイル: test_processor1to2.py プロジェクト: bne/squeal
    def setUp(self):
        # Ick, we need to catch the run event of DummyProcessor, and I can't
        # think of another way to do it.
        self.dummyRun = DummyProcessor.run.im_func
        self.calledBack = Deferred()
        def dummyRun(calledOn):
            self.calledBack.callback(calledOn)
        DummyProcessor.run = dummyRun

        return StubbedTest.setUp(self)
コード例 #9
0
    def setUp(self):
        d = StubbedTest.setUp(self)

        def siteStoreUpgraded(ignored):
            loginSystem = self.store.findUnique(LoginSystem)
            account = loginSystem.accountByAddress(USERNAME, DOMAIN)
            self.subStore = account.avatars.open()
            return self.subStore.whenFullyUpgraded()

        d.addCallback(siteStoreUpgraded)
        return d
コード例 #10
0
    def setUp(self):
        d = StubbedTest.setUp(self)

        def siteStoreUpgraded(ignored):
            loginSystem = self.store.findUnique(LoginSystem)
            account = loginSystem.accountByAddress(USERNAME, DOMAIN)
            self.subStore = account.avatars.open()
            return self.subStore.whenFullyUpgraded()

        d.addCallback(siteStoreUpgraded)
        return d
コード例 #11
0
    def setUp(self):
        # Ick, we need to catch the run event of DummyProcessor, and I can't
        # think of another way to do it.
        self.dummyRun = DummyProcessor.run.__func__
        self.calledBack = Deferred()

        def dummyRun(calledOn):
            self.calledBack.callback(calledOn)

        DummyProcessor.run = dummyRun

        return StubbedTest.setUp(self)
コード例 #12
0
ファイル: test_processor1to2.py プロジェクト: calston/tums
    def setUp(self):
        # Ick, we need to catch the run event of DummyProcessor, and I can't
        # think of another way to do it.
        self.dummyRun = DummyProcessor.run.im_func
        self.dummyRunCalls = []

        def dummyRun(calledOn):
            self.dummyRunCalls.append(calledOn)

        DummyProcessor.run = dummyRun

        return StubbedTest.setUp(self)
コード例 #13
0
 def tearDown(self):
     """
     This test suite is unfortunately awful and buggy and implicitly starts
     upgraders in substores and does not wait for them to complete.  When
     correct error logging was added to the upgrade process, they all broke.
     However, the errors logged here are mostly harmless so they are being
     quashed for the time being.
     """                     # -glyph
     d = StubbedTest.tearDown(self)
     def flushit(ign):
         from epsilon.cooperator import SchedulerStopped
         self.flushLoggedErrors(SchedulerStopped)
         return ign
     return d.addCallback(flushit)
コード例 #14
0
 def setUp(self):
     stub_undefertask1to2.SCHEDULE_LOG = []
     return StubbedTest.setUp(self)
コード例 #15
0
    def tearDown(self):
        # Okay this is a pretty irrelevant method on a pretty irrelevant class,
        # but we'll fix it anyway.
        DummyProcessor.run = self.dummyRun

        return StubbedTest.tearDown(self)
コード例 #16
0
 def setUp(self):
     stub_undefertask1to2.SCHEDULE_LOG = []
     return StubbedTest.setUp(self)
コード例 #17
0
 def setUp(self):
     D = StubbedTest.setUp(self)
     def setUpFinished():
         self.inbox = self.store.findUnique(Inbox)
     D.addCallback(lambda _: setUpFinished())
     return D
コード例 #18
0
ファイル: test_processor1to2.py プロジェクト: bne/squeal
    def tearDown(self):
        # Okay this is a pretty irrelevant method on a pretty irrelevant class,
        # but we'll fix it anyway.
        DummyProcessor.run = self.dummyRun

        return StubbedTest.tearDown(self)
コード例 #19
0
 def setUp(self):
     d = StubbedTest.setUp(self)
     def cbSetUp(ignored):
         self.hook = self.store.findUnique(_SubSchedulerParentHook)
     d.addCallback(cbSetUp)
     return d