annotate tests/test-init.py @ 70:bdc1650f216c

tests: set HGRCPATH so local hgrc's aren't loaded
author Idan Kamara <idankk86@gmail.com>
date Fri, 09 Sep 2011 23:05:57 +0300
parents ce516ed9bc0d
children 07efbd3bd09a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
60
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 import hglib, common, shutil
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3 class test_init(common.basetest):
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 def test_exists(self):
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 self.assertRaises(hglib.error.CommandError, hglib.init)
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 def test_basic(self):
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8 self.client.close()
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 self.client = None
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10 shutil.rmtree('.hg')
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12 self.client = hglib.init()
ce516ed9bc0d hglib: add init command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
13 self.assertTrue(self.client.root().endswith('test_init'))