fune/third_party/python/python-hglib/tests/test-hglib.py
Sofia Carrillo 0c81030974 Bug 1463834 - vendored hglib, updated to python-hglib r=davehunt
--HG--
rename : third_party/python/hglib/LICENSE => third_party/python/python-hglib/LICENSE
rename : third_party/python/hglib/hglib/__init__.py => third_party/python/python-hglib/hglib/__init__.py
rename : third_party/python/hglib/hglib/client.py => third_party/python/python-hglib/hglib/client.py
rename : third_party/python/hglib/hglib/context.py => third_party/python/python-hglib/hglib/context.py
rename : third_party/python/hglib/hglib/error.py => third_party/python/python-hglib/hglib/error.py
rename : third_party/python/hglib/hglib/merge.py => third_party/python/python-hglib/hglib/merge.py
rename : third_party/python/hglib/hglib/templates.py => third_party/python/python-hglib/hglib/templates.py
rename : third_party/python/hglib/hglib/util.py => third_party/python/python-hglib/hglib/util.py
rename : third_party/python/hglib/setup.py => third_party/python/python-hglib/setup.py
extra : rebase_source : 552d93c9e90c04171c8b627c8f4f4fa5ec506cc3
2018-05-31 18:04:54 -07:00

25 lines
836 B
Python

from tests import common
import hglib
class test_hglib(common.basetest):
def setUp(self):
pass
def test_close_fds(self):
"""A weird Python bug that has something to do to inherited file
descriptors, see http://bugs.python.org/issue12786
"""
common.basetest.setUp(self)
client2 = hglib.open()
self.client.close()
def test_open_nonexistent(self):
# setup stuff necessary for basetest.tearDown()
self.clients = []
self._oldopen = hglib.client.hgclient.open
try:
self.clients.append(hglib.open('inexistent'))
# hg 3.5 can't report error (fixed by 7332bf4ae959)
#self.fail('ServerError not raised')
except hglib.error.ServerError as inst:
self.assertTrue('inexistent' in str(inst))