Esempio n. 1
0
    def test_user_times(self):

        meta = MetaData()

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

        assert meta.user_times["foo"] is not None
        assert meta.user_times["foo"] >= before
        assert meta.user_times["foo"] <= after
Esempio n. 2
0
    def test_comparison(self):

        meta1 = MetaData()
        meta2 = MetaData()
        meta2.set_create_time(meta1.create_time)
        assert meta1 == meta2

        meta1.set_create_time(213123)
        assert meta1 != meta2
        meta2.set_create_time(meta1.create_time)
        assert meta1 == meta2

        meta1.set_send_time()
        assert meta1 != meta2
        meta2.set_send_time(meta1.send_time)
        assert meta1 == meta2

        meta1.set_receive_time()
        assert meta1 != meta2
        meta2.set_receive_time(meta1.receive_time)
        assert meta1 == meta2

        meta1.set_deliver_time()
        assert meta1 != meta2
        meta2.set_deliver_time(meta1.deliver_time)
        assert meta1 == meta2

        meta1.set_user_time("foo")
        assert meta1 != meta2
        meta2.set_user_time("foo", meta1.user_times["foo"])
        assert meta1 == meta2

        meta1.set_user_info("foox", "bla")
        assert meta1 != meta2
        meta2.set_user_info("foox", meta1.user_infos["foox"])
        assert meta1 == meta2