def Remove(self):

        view0 = self.views[0]
        sandbox0 = view0.findPath("//sandbox")
        coll0 = sandbox0.findPath("testCollection")

        view1 = self.views[1]
        coll1 = view1.findUUID(coll0.itsUUID)

        for item in coll0:
            if item.displayName == u"meeting rescheduled":
                uuid = item.itsUUID
                break

        item0 = view0.findUUID(uuid)
        item1 = view1.findUUID(uuid)

        coll0.remove(item0)

        sharing.sync(coll0)

        self.assert_(item1 in coll1)
        sharing.sync(coll1)
        self.assert_(item1 not in coll1)
Beispiel #2
0
    def Remove(self):

        view0 = self.views[0]
        sandbox0 = view0.findPath("//sandbox")
        coll0 = sandbox0.findPath("testCollection")

        view1 = self.views[1]
        coll1 = view1.findUUID(coll0.itsUUID)

        for item in coll0:
            if item.displayName == u"meeting rescheduled":
                uuid = item.itsUUID
                break

        item0 = view0.findUUID(uuid)
        item1 = view1.findUUID(uuid)

        coll0.remove(item0)

        sharing.sync(coll0)

        self.assert_(item1 in coll1)
        sharing.sync(coll1)
        self.assert_(item1 not in coll1)
    def Modify(self):
        # change one of the items in both shares

        view0 = self.views[0]
        sandbox0 = view0.findPath("//sandbox")
        coll0 = sandbox0.findPath("testCollection")

        view1 = self.views[1]
        coll1 = view1.findUUID(coll0.itsUUID)

        for item in coll0:
            if item.displayName == u"meeting":
                uuid = item.itsUUID
                break

        item0 = view0.findUUID(uuid)
        event0 = pim.EventStamp(item0)
        item0.displayName = u"meeting rescheduled"
        oldStart = event0.startTime

        tzinfo = view1.tzinfo.default
        newStart = datetime.datetime(2005, 11, 1, 12, 0, 0, 0, tzinfo)
        item1 = view1.findUUID(uuid)
        event1 = pim.EventStamp(item1)
        event1.startTime = newStart

        sharing.sync(coll0)
        sharing.sync(coll1)
        sharing.sync(coll0)

        # Make sure our changes were merged:
        self.assertEqual(item0.displayName, u"meeting rescheduled",
         u"displayName is %s" % (item0.displayName))
        self.assertEqual(item1.displayName, u"meeting rescheduled",
         u"displayName is %s" % (item1.displayName))

        self.assertEqual(event0.startTime, newStart,
         u"startTime is %s" % (event0.startTime))
        self.assertEqual(event1.startTime, newStart,
         u"startTime is %s" % (event1.startTime))
Beispiel #4
0
    def Modify(self):
        # change one of the items in both shares

        view0 = self.views[0]
        sandbox0 = view0.findPath("//sandbox")
        coll0 = sandbox0.findPath("testCollection")

        view1 = self.views[1]
        coll1 = view1.findUUID(coll0.itsUUID)

        for item in coll0:
            if item.displayName == u"meeting":
                uuid = item.itsUUID
                break

        item0 = view0.findUUID(uuid)
        event0 = pim.EventStamp(item0)
        item0.displayName = u"meeting rescheduled"
        oldStart = event0.startTime

        tzinfo = view1.tzinfo.default
        newStart = datetime.datetime(2005, 11, 1, 12, 0, 0, 0, tzinfo)
        item1 = view1.findUUID(uuid)
        event1 = pim.EventStamp(item1)
        event1.startTime = newStart

        sharing.sync(coll0)
        sharing.sync(coll1)
        sharing.sync(coll0)

        # Make sure our changes were merged:
        self.assertEqual(item0.displayName, u"meeting rescheduled",
                         u"displayName is %s" % (item0.displayName))
        self.assertEqual(item1.displayName, u"meeting rescheduled",
                         u"displayName is %s" % (item1.displayName))

        self.assertEqual(event0.startTime, newStart,
                         u"startTime is %s" % (event0.startTime))
        self.assertEqual(event1.startTime, newStart,
                         u"startTime is %s" % (event1.startTime))