示例#1
0
 def test_check_path(self):
     # valid paths are returned unchanged
     path = os.path.join(self.path_dir, 'my.exe')
     open(path, 'w').write('my script')
     os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC)
     assert check_path(path) == path
示例#2
0
 def test_check_path(self):
     # valid paths are returned unchanged
     path = os.path.join(self.path_dir, 'my.exe')
     open(path, 'w').write('my script')
     os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC)
     assert check_path(path) == path
示例#3
0
def test_check_path_not_existing(home_dir):
    # the path given must exist
    with pytest.raises(ValueError):
        check_path('not-existing-path')
示例#4
0
def test_check_path_not_existing(home_dir):
    # the path given must exist
    with pytest.raises(ValueError):
        check_path('not-existing-path')