Skip to content
Snippets Groups Projects

Create an unreadable temp directory for testing PermissionError

Merged Thomas Kluyver requested to merge fix/test-permissionerror into master
1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
+ 4
3
@@ -49,7 +49,7 @@ INVALID_BEAMTIME = {
}
@pytest.mark.requires_gpfs
def test_check_files():
def test_check_files(tmp_path):
in_folder = '/gpfs/exfel/exp/CALLAB/202031/p900113/raw'
runs = [9985, 9984]
karabo_das = ['AGIPD06', 'AGIPD07']
@@ -62,9 +62,10 @@ def test_check_files():
runs = [1, 2]
assert not check_files(in_folder, runs, karabo_das)
noaccess = tmp_path / "noaccess"
noaccess.mkdir(mode=0o000) # make a directory we can't read
with pytest.raises(PermissionError):
in_folder = '/gpfs/maxwell/home/achilles' # arbitrarily chosen
check_files(in_folder, runs, karabo_das)
check_files(str(noaccess), runs, karabo_das)
def test_merge():
Loading