-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sourcery refactored master branch #1
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,8 +59,12 @@ def test_sshfs(tmpdir, debug, cache_timeout, sync_rd, multiconn, capfd): | |
mnt_dir = str(tmpdir.mkdir('mnt')) | ||
src_dir = str(tmpdir.mkdir('src')) | ||
|
||
cmdline = base_cmdline + [ pjoin(basename, 'sshfs'), | ||
'-f', 'localhost:' + src_dir, mnt_dir ] | ||
cmdline = base_cmdline + [ | ||
pjoin(basename, 'sshfs'), | ||
'-f', | ||
f'localhost:{src_dir}', | ||
mnt_dir, | ||
] | ||
Comment on lines
-62
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
if debug: | ||
cmdline += [ '-o', 'sshfs_debug' ] | ||
|
||
|
@@ -133,7 +137,7 @@ def os_create(name): | |
|
||
def tst_unlink(src_dir, mnt_dir, cache_timeout): | ||
name = name_generator() | ||
fullname = mnt_dir + "/" + name | ||
fullname = f"{mnt_dir}/{name}" | ||
Comment on lines
-136
to
+140
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
with open(pjoin(src_dir, name), 'wb') as fh: | ||
fh.write(b'hello') | ||
if cache_timeout: | ||
|
@@ -148,7 +152,7 @@ def tst_unlink(src_dir, mnt_dir, cache_timeout): | |
|
||
def tst_mkdir(mnt_dir): | ||
dirname = name_generator() | ||
fullname = mnt_dir + "/" + dirname | ||
fullname = f"{mnt_dir}/{dirname}" | ||
Comment on lines
-151
to
+155
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
os.mkdir(fullname) | ||
fstat = os.stat(fullname) | ||
assert stat.S_ISDIR(fstat.st_mode) | ||
|
@@ -158,7 +162,7 @@ def tst_mkdir(mnt_dir): | |
|
||
def tst_rmdir(src_dir, mnt_dir, cache_timeout): | ||
name = name_generator() | ||
fullname = mnt_dir + "/" + name | ||
fullname = f"{mnt_dir}/{name}" | ||
Comment on lines
-161
to
+165
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
os.mkdir(pjoin(src_dir, name)) | ||
if cache_timeout: | ||
safe_sleep(cache_timeout+1) | ||
|
@@ -172,7 +176,7 @@ def tst_rmdir(src_dir, mnt_dir, cache_timeout): | |
|
||
def tst_symlink(mnt_dir): | ||
linkname = name_generator() | ||
fullname = mnt_dir + "/" + linkname | ||
fullname = f"{mnt_dir}/{linkname}" | ||
Comment on lines
-175
to
+179
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
os.symlink("/imaginary/dest", fullname) | ||
fstat = os.lstat(fullname) | ||
assert stat.S_ISLNK(fstat.st_mode) | ||
|
@@ -320,9 +324,9 @@ def tst_readdir(src_dir, mnt_dir): | |
newdir = name_generator() | ||
src_newdir = pjoin(src_dir, newdir) | ||
mnt_newdir = pjoin(mnt_dir, newdir) | ||
file_ = src_newdir + "/" + name_generator() | ||
subdir = src_newdir + "/" + name_generator() | ||
subfile = subdir + "/" + name_generator() | ||
file_ = f"{src_newdir}/{name_generator()}" | ||
subdir = f"{src_newdir}/{name_generator()}" | ||
subfile = f"{subdir}/{name_generator()}" | ||
Comment on lines
-323
to
+329
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
os.mkdir(src_newdir) | ||
shutil.copyfile(TEST_FILE, file_) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ def umount(mount_process, mnt_dir): | |
if code is not None: | ||
if code == 0: | ||
return | ||
pytest.fail('file system process terminated with code %s' % (code,)) | ||
pytest.fail(f'file system process terminated with code {code}') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
time.sleep(0.1) | ||
elapsed += 0.1 | ||
pytest.fail('mount process did not terminate') | ||
|
@@ -92,7 +92,7 @@ def fuse_test_marker(): | |
try: | ||
fd = os.open('/dev/fuse', os.O_RDWR) | ||
except OSError as exc: | ||
return skip('Unable to open /dev/fuse: %s' % exc.strerror) | ||
return skip(f'Unable to open /dev/fuse: {exc.strerror}') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
else: | ||
os.close(fd) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
check_test_output
refactored with the following changes:use-fstring-for-formatting
)use-named-expression
)replace-interpolation-with-fstring
)use-getitem-for-re-match-groups
)