Mercurial > python-hglib
view tests/test-heads.py @ 200:7da1dad166b5
client: ignore close() on non-open clients (issue5751)
Closing a client twice currently triggers a rather confusing exception.
Instead, follow the convention set by Python's file objects, and ignore close()
commands on non-open clients.
author | Gábor Stefanik <gabor.stefanik@nng.com> |
---|---|
date | Mon, 12 Feb 2018 14:54:09 +0100 |
parents | c1b966866ed7 |
children |
line wrap: on
line source
from tests import common from hglib.util import b class test_heads(common.basetest): def test_empty(self): self.assertEquals(self.client.heads(), []) def test_basic(self): self.append('a', 'a') rev, node0 = self.client.commit(b('first'), addremove=True) self.assertEquals(self.client.heads(), [self.client.tip()]) self.client.branch(b('foo')) self.append('a', 'a') rev, node1 = self.client.commit(b('second')) self.assertEquals(self.client.heads(node0, topological=True), [])