view tests/test-bookmarks.py @ 112:6190432f1d39

tests: fix test-bookmarks to match changed hg behavior After a fix in hg related to activating bookmarks, a test started failing
author Alexander Plavin <me@aplavin.ru>
date Thu, 02 May 2013 21:44:53 +0400
parents 5fe53db61aa4
children 2e2055fc66c3
line wrap: on
line source

import common

class test_bookmarks(common.basetest):
    def test_empty(self):
        self.assertEquals(self.client.bookmarks(), ([], -1))

    def test_basic(self):
        self.append('a', 'a')
        rev0, node0 = self.client.commit('first', addremove=True)
        self.append('a', 'a')
        rev1, node1 = self.client.commit('second')

        self.client.bookmark('zero', rev0)
        self.assertEquals(self.client.bookmarks(),
                          ([('zero', rev0, node0[:12])], -1))

        self.client.bookmark('one', rev1)
        self.assertEquals(self.client.bookmarks(),
                          ([('one', rev1, node1[:12]),
                            ('zero', rev0, node0[:12])], -1))

    #def test_spaces(self):
    #    self.client.bookmark('s pace', self.rev0)
    #    self.assertEquals(self.client.bookmarks(),
    #                      ([('s pace', 0, self.rev0.node[:12])], -1))