annotate tests/test-init.py @ 89:351d2799f145
client: added context manager protocol methods
This allows client objects to be used with the 'with' statement and be closed
automatically when the 'with' context exits.
author |
Jeff Laughlin <jmlaughlin@integrated-informatics.com> |
date |
Wed, 23 Nov 2011 09:57:37 -0500 |
parents |
ce516ed9bc0d |
children |
07efbd3bd09a |
rev |
line source |
60
|
1 import hglib, common, shutil
|
|
2
|
|
3 class test_init(common.basetest):
|
|
4 def test_exists(self):
|
|
5 self.assertRaises(hglib.error.CommandError, hglib.init)
|
|
6
|
|
7 def test_basic(self):
|
|
8 self.client.close()
|
|
9 self.client = None
|
|
10 shutil.rmtree('.hg')
|
|
11
|
|
12 self.client = hglib.init()
|
|
13 self.assertTrue(self.client.root().endswith('test_init'))
|