view tests/test-tags.py @ 67:730c42743ba3

tests: cleanup on test finish so Windows doesn't complain about used files - chdir out of the test dir before rmtree - cache instances of hgclient and close them explicitly on tearDown before rmtree
author Idan Kamara <idankk86@gmail.com>
date Mon, 05 Sep 2011 20:51:29 +0300
parents 77ebb51f5f36
children 4359cabcb0cc
line wrap: on
line source

import common
import hglib

class test_tags(common.basetest):
    def test_basic(self):
        self.append('a', 'a')
        rev, node = self.client.commit('first', addremove=True)
        self.client.tag('my tag')
        self.client.tag('local tag', rev=rev, local=True)

        # filecache that was introduced in 2.0 makes us see the local tag, for
        # now we have to reconnect
        if self.client.version < (2, 0, 0):
            self.client = hglib.open()

        tags = self.client.tags()
        self.assertEquals(tags, [('tip', 1, self.client.tip().node[:12], False),
                                 ('my tag', 0, node[:12], False),
                                 ('local tag', 0, node[:12], True)])