Ejemplo n.º 1
0
    def setUpForObject(self, obj):
        # pylint: disable=attribute-defined-outside-init
        self.object = obj
        self.updates = []
        self.st = SubscriptionTester()

        def send(value):
            self.updates.extend(json.loads(value))

        self.stream = StateStreamInner(send,
                                       self.object,
                                       'urlroot',
                                       subscription_context=self.st.context)
Ejemplo n.º 2
0
    def setUpForObject(self, obj):
        # pylint: disable=attribute-defined-outside-init
        self.object = obj
        self.updates = []
        self.st = SubscriptionTester()

        def send(value):
            if isinstance(value, unicode):
                self.updates.extend(json.loads(value))
            elif isinstance(value, bytes):
                self.updates.append(['actually_binary', value])

        self.stream = StateStreamInner(send,
                                       self.object,
                                       'urlroot',
                                       subscription_context=self.st.context)
Ejemplo n.º 3
0
 def setUp(self):
     self.st = SubscriptionTester()
     self.o = ValueAndBlockSpecimen(ValueAndBlockSpecimen(ExportedState()))
     self.calls = 0
     self.d = PersistenceChangeDetector(self.o, self.__callback, subscription_context=self.st.context)