-
-
Notifications
You must be signed in to change notification settings - Fork 743
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
PR: Remove BaseTestCase from testsuite/
#7742
PR: Remove BaseTestCase from testsuite/
#7742
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #7742 +/- ##
==========================================
+ Coverage 83.65% 83.67% +0.01%
==========================================
Files 66 66
Lines 11915 11915
Branches 2159 2159
==========================================
+ Hits 9968 9970 +2
+ Misses 1371 1370 -1
+ Partials 576 575 -1 |
@ThomasWaldmann After these committed changes, there are only four test files remaining in the
I feel that removing the These are the last few files standing between |
testsuite/
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.
looks good. some more places could use parametrize I guess.
src/borg/testsuite/helpers.py
Outdated
for path in rejected_dotdot_paths: | ||
with pytest.raises(ValueError, match="unexpected '..' element in path"): | ||
make_path_safe(path) | ||
def test_remove_dot_prefixes(): |
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.
the original name had dotdot.
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.
seen this?
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.
Yes, I've got this corrected locally. Adding some additional parameterization to this file and will push soon 🙂
I will make that happen. Also, are you okay with me removing BaseTestCase from the 3 files in |
Maybe stay away from the selftest stuff for now until the other stuff is done. |
Cleaned up and parametrized as needed in |
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.
Tests look much better with parametrize now.
Just the imports somehow got ugly, IMHO.
src/borg/testsuite/helpers.py
Outdated
from ..helpers import ( | ||
archivename_validator, | ||
bin_to_hex, | ||
binary_to_json, | ||
chunkit, | ||
clean_lines, | ||
dash_open, | ||
eval_escapes, | ||
format_file_size, | ||
parse_file_size, | ||
format_timedelta, | ||
format_line, | ||
PlaceholderError, | ||
format_timedelta, | ||
get_base_dir, | ||
get_cache_dir, | ||
get_config_dir, | ||
get_keys_dir, | ||
get_runtime_dir, | ||
get_security_dir, | ||
interval, | ||
is_slow_msgpack, | ||
iter_separated, | ||
make_path_safe, | ||
msgpack, | ||
parse_file_size, | ||
parse_timestamp, | ||
partial_format, | ||
popen_with_error_handling, | ||
remove_dotdot_prefixes, | ||
replace_placeholders, | ||
safe_ns, | ||
safe_s, | ||
safe_unlink, | ||
swidth_slice, | ||
text_to_json, | ||
text_validator, | ||
yes, | ||
) |
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.
That stuff uses to be grouped (more or less what belongs together somehow).
Or did you somehow trigger black doing this?
I rather prefer the horizontal grouped form, less scrolling.
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.
I'll get this changed back to the original 🙂
@ThomasWaldmann As far as removing BaseTestCase from the |
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.
LGTM.
Now that the
ArchiverBaseTestCase
has been removed fromtestsuite/archiver/__init__.py
, I would now like to removeBaseTestCase
from thetestsuite/__init__.py
. After @ThomasWaldmann's recent update to theBaseTestCase
here, all that remains are a few assert methods that seem superfluous and could be replaced with the built-in python asserts.