comparison tests/__init__.py @ 7:eac8be119d81

tests: rearrange tests and use nosetests - provide package setup/teardown methods that fixes the environment - introduce a basetest that initializes a repository in a temp dir
author Idan Kamara <idankk86@gmail.com>
date Sat, 23 Jul 2011 22:55:39 +0300
parents
children 730c42743ba3
comparison
equal deleted inserted replaced
6:96f8c5095e2e 7:eac8be119d81
1 import os, tempfile, sys, shutil
2
3 def setUp():
4 os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C'
5 os.environ['TZ'] = 'GMT'
6 os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>"
7 os.environ['CDPATH'] = ''
8 os.environ['COLUMNS'] = '80'
9 os.environ['GREP_OPTIONS'] = ''
10 os.environ['http_proxy'] = ''
11
12 os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
13 os.environ["HGMERGE"] = "internal:merge"
14 os.environ["HGUSER"] = "test"
15 os.environ["HGENCODING"] = "ascii"
16 os.environ["HGENCODINGMODE"] = "strict"
17 tmpdir = tempfile.mkdtemp('', 'python-hglib.')
18 os.environ["HGTMP"] = os.path.realpath(tmpdir)
19
20 def tearDown(self):
21 shutil.rmtree(os.environ["HGTMP"])