"""
$URL: svn+ssh://svn.mems-exchange.org/repos/trunk/dulcinea/lib/test/utest_timestamped.py $
$Id: utest_timestamped.py 31155 2008-09-18 15:54:09Z dbinger $
"""
from dulcinea.common import CommonTest
from dulcinea.timestamped import Timestamped, timestamp_sorted
from dulcinea.timestamped import reverse_timestamp_sorted
from qp.lib.spec import Specified

class Test (CommonTest):

    def a(self):
        class T(Specified, Timestamped):
            pass
        x = T()
        y = T()
        assert timestamp_sorted([x, y]) == [x,y]
        assert reverse_timestamp_sorted([x, y]) == [y,x]
        x.set_timestamp()
        assert timestamp_sorted([x, y]) == [y,x]

if __name__ == "__main__":
    Test()
