Changeset 1440 in tailor


Ignore:
Timestamp:
07/25/07 20:55:53 (6 years ago)
Author:
techtonik@…
Hash name:
20070725185553-138f5-339a0a57fcd950d4dad20276b8c617d5785f1ab6
Message:

test suite windows path correction

Location:
vcpx/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • vcpx/tests/config.py

    r1384 r1440  
    1313    "Test the configuration system" 
    1414 
     15    TESTDIR = None 
     16 
    1517    def setUp(self): 
    1618        from os import mkdir, getcwd 
    1719        from os.path import exists, split, join 
     20        from tempfile import gettempdir 
    1821        from atexit import register 
    1922        from shutil import rmtree 
    2023 
     24        self.TESTDIR = join(gettempdir(), 'tailor-tests') 
     25 
    2126        tailor_repo = getcwd() 
    22         while tailor_repo != '/' and not exists(join(tailor_repo, '_darcs')): 
     27        while tailor_repo != split(tailor_repo)[0] and not exists(join(tailor_repo, '_darcs')): 
    2328            tailor_repo = split(tailor_repo)[0] 
    2429        assert exists(join(tailor_repo, '_darcs')), "Tailor Darcs repository not found!" 
    2530        self.tailor_repo = tailor_repo 
    26         if not exists('/tmp/tailor-tests'): 
    27             mkdir('/tmp/tailor-tests') 
    28             register(rmtree, '/tmp/tailor-tests') 
     31        if not exists(self.TESTDIR): 
     32            mkdir(self.TESTDIR) 
     33            register(rmtree, self.TESTDIR) 
    2934 
    3035    def getTestConfiguration(self, testname): 
     
    4752 
    4853        project1 = Project('project1', config) 
    49         self.assertEqual(project1.rootdir, '/tmp/tailor-tests') 
     54        self.assertEqual(project1.rootdir, self.TESTDIR) 
    5055        self.assertEqual(project1.source.name, 'svn:project1repo') 
    5156        self.assertEqual(project1.target.name, 'darcs:project1') 
     
    113118        """Verify that the state file is computed the way it should""" 
    114119 
    115         from os.path import expanduser 
     120        from os.path import expanduser, join 
    116121 
    117122        config = Config(self.getTestConfiguration("config-basic_test"), 
     
    119124 
    120125        project1 = Project('project1', config) 
    121         self.assertEqual(project1.state_file.filename, '/tmp/tailor-tests/project1.state') 
     126        self.assertEqual(project1.state_file.filename, join(self.TESTDIR, 'project1.state')) 
    122127        project3 = Project('project3', config) 
    123         self.assertEqual(project3.state_file.filename, '/tmp/tailor-tests/_darcs/tailor.state') 
     128        self.assertEqual(project3.state_file.filename, join(self.TESTDIR, '_darcs', 'tailor.state')) 
    124129        project4 = Project('project4', config) 
    125130        self.assertEqual(project4.state_file.filename, expanduser('~/tailorize/project4.state')) 
  • vcpx/tests/tailor.py

    r1408 r1440  
    323323class OperationalTest(TestCase): 
    324324 
    325     TESTDIR = '/tmp/tailor-tests' 
     325    TESTDIR = None 
    326326 
    327327    def setUp(self): 
    328328        from os import mkdir, getcwd 
    329329        from os.path import exists, split, join 
     330        from tempfile import gettempdir 
    330331        from atexit import register 
    331332        from shutil import rmtree 
    332333        from vcpx.tests import DEBUG 
    333334 
     335        self.TESTDIR = join(gettempdir(), 'tailor-tests') 
     336 
    334337        tailor_repo = getcwd() 
    335         while tailor_repo != '/' and not exists(join(tailor_repo, '_darcs')): 
     338        while tailor_repo != split(tailor_repo)[0] and not exists(join(tailor_repo, '_darcs')): 
    336339            tailor_repo = split(tailor_repo)[0] 
    337340        assert exists(join(tailor_repo, '_darcs')), "Tailor Darcs repository not found!" 
     
    426429 
    427430    def testBazaarAndPython23(self): 
    428         "Test we detect early when running under Python < 2.4" 
     431        "Bazaar test we detect early when running under Python < 2.4" 
    429432 
    430433        from sys import version_info 
  • vcpx/tests/fixed_bugs.py

    r1280 r1440  
    1919    """Ensure already fixed bugs don't get reintroduced""" 
    2020 
    21     TESTDIR = '/tmp/tailor-tests/fixed-bugs' 
     21    TESTDIR = None 
    2222 
    2323    ALL_TARGET_VCS = [ 'arx', 'bzr', 'cdv', 'cg', 'cvs', 'cvsps', 'darcs', 'git', 'hg', 'monotone', 'svn' ] 
     
    4242    def setUp(self): 
    4343        from os import makedirs 
     44        from tempfile import gettempdir 
    4445        from shutil import rmtree 
    4546        from atexit import register 
     47 
     48        self.TESTDIR = join(gettempdir(), 'tailor-tests', 'fixed-bugs') 
    4649 
    4750        self.test_name = self.id().split('.')[-1] 
Note: See TracChangeset for help on using the changeset viewer.