Example #1
0
    def testUserTimes(self):

        meta = MetaData()

        before = time.time()
        meta.setUserTime("foo")
        after = time.time()

        self.assertNotEquals(None, meta.userTimes["foo"])
        self.assertTrue(meta.userTimes["foo"] >= before)
        self.assertTrue(meta.userTimes["foo"] <= after)
Example #2
0
    def testComparison(self):

        meta1 = MetaData()
        meta2 = MetaData()
        meta2.setCreateTime(meta1.getCreateTime())
        self.assertEquals(meta1, meta2)

        meta1.setCreateTime(213123)
        self.assertNotEquals(meta1, meta2)
        meta2.setCreateTime(meta1.getCreateTime())
        self.assertEquals(meta1, meta2)

        meta1.setSendTime()
        self.assertNotEquals(meta1, meta2)
        meta2.setSendTime(meta1.getSendTime())
        self.assertEquals(meta1, meta2)

        meta1.setReceiveTime()
        self.assertNotEquals(meta1, meta2)
        meta2.setReceiveTime(meta1.getReceiveTime())
        self.assertEquals(meta1, meta2)

        meta1.setDeliverTime()
        self.assertNotEquals(meta1, meta2)
        meta2.setDeliverTime(meta1.getDeliverTime())
        self.assertEquals(meta1, meta2)

        meta1.setUserTime("foo")
        self.assertNotEquals(meta1, meta2)
        meta2.setUserTime("foo", meta1.getUserTimes()["foo"])
        self.assertEquals(meta1, meta2)

        meta1.setUserInfo("foox", "bla")
        self.assertNotEquals(meta1, meta2)
        meta2.setUserInfo("foox", meta1.getUserInfos()["foox"])
        self.assertEquals(meta1, meta2)