def setUp(self):
        StreamTest.setUp(self)

        self.doc = handler_document(self.name)
        self.identity = Identity("*****@*****.**", ["rotate", 5], ["local", None, "kirk"])
        self.owner = Owner(self.identity, make_jack=False)
        self.owner.own_document(self.doc)
 def setUp(self):
     self.doc = handler_document('echo_chamber')
     self.ident = identity()
     self.ev  = Event({'x':'y'}, self.ident, 'stormageddon')
     self.quorum = Quorum(self.ev, self.doc._qs)
     self.owner = Owner(self.ident, make_jack=False)
     self.owner.own_document(self.doc)
    def setUp(self):
        StreamTest.setUp(self)

        self.doc = handler_document("echo_chamber")
        self.ev  = Event({'x':'y'}, identity("atlas"), self.doc.version)
        self.quorum = Quorum(self.ev, self.doc._qs)
        self.quorum.document = self.doc
        self.ident = identity()
        self.owner = Owner(self.ident, make_jack=False)
        self.owner.own_document(self.doc)
Exemple #4
0
    def setUp(self):
        StreamTest.setUp(self)

        self.router = Router()
        self.mitzi  = Owner(identity("mitzi"),  self.router)
        self.atlas  = Owner(identity("atlas"),  self.router)
        self.victor = Owner(identity("victor"), self.router)
        self.mitzi.identities.sync(
            self.atlas.identities,
            self.victor.identities,
        )

        # Document that mitzi and atlas are part of, but victor is not.
        # Separate identical starting points for all of them.
        self.mdoc = handler_document("tag_team")
        self.adoc = handler_document("tag_team")
        self.vdoc = handler_document("tag_team")
        self.mitzi.own_document(self.mdoc)
        self.atlas.own_document(self.adoc)
        self.victor.own_document(self.vdoc)
    def test_init(self):
        # Do setup for testing a good owner.
        owner = Owner(identity(), make_jack = False)

        key = String('["local",null,"mitzi"]')
        self.assertIsInstance(owner.identities, IdentityCache)
        self.assertIn(key, owner.identities)
        self.assertIsInstance(owner.identities[key], Identity)

        doc = handler_document("echo_chamber")
        self.assertIsInstance(doc.handler, Resource)
        owner.own_document(doc)
 def setUp(self):
     self.doc = handler_document("tag_team")
     self.qs  = self.doc._qs
     self.mitzi = identity('mitzi')
     self.atlas = identity('atlas')
     self.ev1 = Event({"hello":"world"}, self.mitzi, self.doc.version)
     self.ev2 = Event({"turtle":"food"}, self.mitzi, self.doc.version)
     self.q1 = Quorum(self.ev1, self.qs)
     self.q2 = Quorum(self.ev2, self.qs)
     self.owner = Owner(self.mitzi, make_jack=False)
     self.owner.own_document(self.doc)
     self.owner.identities.update_ident(self.atlas)