##// END OF EJS Templates
fixed edge case in tests when we run them from virtualmachine and not as owner of files
marcink -
r3501:3d5f4d2f beta
parent child Browse files
Show More
@@ -1,62 +1,64 b''
1 1 """
2 2 Unit tests configuration module for vcs.
3 3 """
4 4
5 5 import os
6 6 import time
7 7 import hashlib
8 8 import tempfile
9 9 import datetime
10 import shutil
10 11 from rhodecode.tests import *
11 12 from utils import get_normalized_path
12 13 from os.path import join as jn
13 14
14 15 TEST_TMP_PATH = TESTS_TMP_PATH
15 16 #__all__ = (
16 17 # 'TEST_HG_REPO', 'TEST_GIT_REPO', 'HG_REMOTE_REPO', 'GIT_REMOTE_REPO',
17 18 # 'SCM_TESTS',
18 19 #)
19 20 #
20 21 #SCM_TESTS = ['hg', 'git']
21 22 #uniq_suffix = str(int(time.mktime(datetime.datetime.now().timetuple())))
22 23 #
23 24 THIS = os.path.abspath(os.path.dirname(__file__))
24 25 #
25 26 #GIT_REMOTE_REPO = 'git://github.com/codeinn/vcs.git'
26 27 #
27 28 #TEST_TMP_PATH = os.environ.get('VCS_TEST_ROOT', '/tmp')
28 29 #TEST_GIT_REPO = os.environ.get('VCS_TEST_GIT_REPO',
29 30 # jn(TEST_TMP_PATH, 'vcs-git'))
30 31 #TEST_GIT_REPO_CLONE = os.environ.get('VCS_TEST_GIT_REPO_CLONE',
31 32 # jn(TEST_TMP_PATH, 'vcsgitclone%s' % uniq_suffix))
32 33 #TEST_GIT_REPO_PULL = os.environ.get('VCS_TEST_GIT_REPO_PULL',
33 34 # jn(TEST_TMP_PATH, 'vcsgitpull%s' % uniq_suffix))
34 35 #
35 36 #HG_REMOTE_REPO = 'http://bitbucket.org/marcinkuzminski/vcs'
36 37 #TEST_HG_REPO = os.environ.get('VCS_TEST_HG_REPO',
37 38 # jn(TEST_TMP_PATH, 'vcs-hg'))
38 39 #TEST_HG_REPO_CLONE = os.environ.get('VCS_TEST_HG_REPO_CLONE',
39 40 # jn(TEST_TMP_PATH, 'vcshgclone%s' % uniq_suffix))
40 41 #TEST_HG_REPO_PULL = os.environ.get('VCS_TEST_HG_REPO_PULL',
41 42 # jn(TEST_TMP_PATH, 'vcshgpull%s' % uniq_suffix))
42 43 #
43 44 #TEST_DIR = os.environ.get('VCS_TEST_ROOT', tempfile.gettempdir())
44 45 #TEST_REPO_PREFIX = 'vcs-test'
45 46 #
46 47 #
47 48 #def get_new_dir(title):
48 49 # """
49 50 # Returns always new directory path.
50 51 # """
51 52 # name = TEST_REPO_PREFIX
52 53 # if title:
53 54 # name = '-'.join((name, title))
54 55 # hex = hashlib.sha1(str(time.time())).hexdigest()
55 56 # name = '-'.join((name, hex))
56 57 # path = os.path.join(TEST_DIR, name)
57 58 # return get_normalized_path(path)
58 59
59 60 PACKAGE_DIR = os.path.abspath(os.path.join(
60 61 os.path.dirname(__file__), '..'))
61
62 TEST_USER_CONFIG_FILE = jn(THIS, 'aconfig')
62 _dest = jn(TESTS_TMP_PATH,'aconfig')
63 shutil.copy(jn(THIS, 'aconfig'), _dest)
64 TEST_USER_CONFIG_FILE = _dest
General Comments 0
You need to be logged in to leave comments. Login now