~allanlesage/uci-engine/coverage-extractor

« back to all changes in this revision

Viewing changes to juju-deployer/test_deploy.py

  • Committer: Chris Johnston
  • Author(s): Vincent Ladeuil
  • Date: 2014-03-06 20:12:48 UTC
  • mfrom: (315.2.8 1287740-deps-first)
  • Revision ID: chris_johnston-20140306201248-n3whrck7059yp35h
[r=Evan Dandrea, PS Jenkins bot] Reduce payload size and use local (and persistent) branches for dependencies running from source. 1287740,1288673 from Vincent Ladeuil

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
import shutil
9
9
import subprocess
10
10
 
 
11
 
 
12
from ucitests import fixtures
 
13
 
 
14
 
11
15
sys.path.append(os.path.abspath(os.path.dirname(sys.argv[0])))
12
16
import deploy
13
17
 
57
61
            deploy.check_bootstrapped()
58
62
 
59
63
    def test_install_deployer(self):
 
64
        fixtures.set_uniq_cwd(self)
60
65
        with mock.patch.dict('os.environ', {'PYTHONPATH': ''}):
61
 
            deployer_dir = deploy.install_deployer()
62
 
            self.addCleanup(lambda: shutil.rmtree(deployer_dir))
 
66
            deployer_dir = deploy.install_deployer('.')
63
67
            self.assertTrue(os.path.exists(os.path.join(deployer_dir, '.bzr')))
64
 
            self.assertEqual(os.environ['PYTHONPATH'], '%s' % deployer_dir)
 
68
            self.assertEqual(deployer_dir, os.environ['PYTHONPATH'])
65
69
            deployer_script = os.path.join(deployer_dir, 'juju-deployer')
66
70
            self.assertTrue(os.access(deployer_script, os.X_OK))
67
71
            self.assertTrue(os.path.exists(deployer_script))