Mercurial > python-hglib
diff tests/test-init.py @ 60:ce516ed9bc0d
hglib: add init command
There's not much value to adding this to hgclient since that will require a
repo in the first place. Instead we're providing this as a top level function
so users don't have to create a repo by themselves.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 19 Aug 2011 20:15:03 +0300 |
parents | |
children | 07efbd3bd09a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-init.py Fri Aug 19 20:15:03 2011 +0300 @@ -0,0 +1,13 @@ +import hglib, common, shutil + +class test_init(common.basetest): + def test_exists(self): + self.assertRaises(hglib.error.CommandError, hglib.init) + + def test_basic(self): + self.client.close() + self.client = None + shutil.rmtree('.hg') + + self.client = hglib.init() + self.assertTrue(self.client.root().endswith('test_init'))