Esempio n. 1
0
    def setUp(self):
        self.tmpdir = tempfile.mkdtemp()

        make_exe = os.path.join(self.tmpdir, 'make')
        with open(make_exe, 'w') as f:
            f.write('#!/bin/sh\n')
            f.write('echo "$@"')
        os.chmod(make_exe, 0o700)

        path_put_first('PATH', [self.tmpdir])
Esempio n. 2
0
def test_path_put_first(prepare_environment_for_tests):
    envutil.path_set('TEST_ENV_VAR', test_paths)
    expected = ['/usr/bin', '/new_nonsense_path/a/b']
    expected.extend([p for p in test_paths if p != '/usr/bin'])
    envutil.path_put_first('TEST_ENV_VAR', expected)
    assert(envutil.get_path('TEST_ENV_VAR') == expected)