view tests/test-bookmarks.py @ 87:5661d5f7e39b

client: make varargs ordering py2.4-compatible
author Matt Mackall <mpm@selenic.com>
date Thu, 17 Nov 2011 12:54:37 -0600
parents ca0d7e212cf8
children 5fe53db61aa4
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('0', rev0)
        self.assertEquals(self.client.bookmarks(),
                          ([('0', rev0, node0[:12])], -1))

        self.client.bookmark('1', rev1)
        self.assertEquals(self.client.bookmarks(),
                          ([('0', rev0, node0[:12]),
                            ('1', rev1, node1[: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))