def test_publishable(self):
        try:
            os.unlink('None-None-TESTING.pub') # from RemotePublished.getFileName
        except __HOLE__:
            pass # Sometimes it's not there.
        c, s, pump = connectedServerAndClient()
        foo = GetPublisher()
        # foo.pub.timestamp = 1.0
        s.setNameForLocal("foo", foo)
        bar = c.remoteForName("foo")
        accum = []
        bar.callRemote('getPub').addCallbacks(accum.append, self.thunkErrorBad)
        pump.flush()
        obj = accum.pop()
        self.assertEquals(obj.activateCalled, 1)
        self.assertEquals(obj.isActivated, 1)
        self.assertEquals(obj.yayIGotPublished, 1)
        # timestamp's dirty, we don't have a cache file
        self.assertEquals(obj._wasCleanWhenLoaded, 0)
        c, s, pump = connectedServerAndClient()
        s.setNameForLocal("foo", foo)
        bar = c.remoteForName("foo")
        bar.callRemote('getPub').addCallbacks(accum.append, self.thunkErrorBad)
        pump.flush()
        obj = accum.pop()
        # timestamp's clean, our cache file is up-to-date
        self.assertEquals(obj._wasCleanWhenLoaded, 1)
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_pb.py/BrokerTestCase.test_publishable