Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 4
0
    def setUp(self):
        d = StubbedTest.setUp(self)

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

        d.addCallback(cbSetUp)
        return d
Exemplo n.º 5
0
    def setUp(self):
        D = StubbedTest.setUp(self)

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

        D.addCallback(lambda _: setUpFinished())
        return D
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 8
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.im_func
        self.calledBack = Deferred()
        def dummyRun(calledOn):
            self.calledBack.callback(calledOn)
        DummyProcessor.run = dummyRun

        return StubbedTest.setUp(self)
    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
    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
Exemplo n.º 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)
Exemplo n.º 12
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.im_func
        self.dummyRunCalls = []

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

        DummyProcessor.run = dummyRun

        return StubbedTest.setUp(self)
Exemplo n.º 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)
Exemplo n.º 14
0
 def setUp(self):
     stub_undefertask1to2.SCHEDULE_LOG = []
     return StubbedTest.setUp(self)
Exemplo n.º 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)
 def setUp(self):
     stub_undefertask1to2.SCHEDULE_LOG = []
     return StubbedTest.setUp(self)
Exemplo n.º 17
0
 def setUp(self):
     D = StubbedTest.setUp(self)
     def setUpFinished():
         self.inbox = self.store.findUnique(Inbox)
     D.addCallback(lambda _: setUpFinished())
     return D
Exemplo n.º 18
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)
Exemplo n.º 19
0
 def setUp(self):
     d = StubbedTest.setUp(self)
     def cbSetUp(ignored):
         self.hook = self.store.findUnique(_SubSchedulerParentHook)
     d.addCallback(cbSetUp)
     return d