Skip to content

Delete error solved#180

Open
bornagain1981 wants to merge 6 commits intopytroll:mainfrom
bornagain1981:main
Open

Delete error solved#180
bornagain1981 wants to merge 6 commits intopytroll:mainfrom
bornagain1981:main

Conversation

@bornagain1981
Copy link

@bornagain1981 bornagain1981 commented Sep 8, 2023

On server.py the delete option accepts only boolean False, without quotes. An error occurred when you're working for the decompression of files on the fly.

@codecov
Copy link

codecov bot commented Sep 8, 2023

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.55%. Comparing base (c9f33e6) to head (c7d630c).
⚠️ Report is 163 commits behind head on main.

Files with missing lines Patch % Lines
trollmoves/server.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #180      +/-   ##
==========================================
- Coverage   90.57%   90.55%   -0.02%     
==========================================
  Files          24       24              
  Lines        5239     5240       +1     
==========================================
  Hits         4745     4745              
- Misses        494      495       +1     
Flag Coverage Δ
unittests 90.55% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need a unit test that checks the three options work:

  • user doesn't define delete in the config -> the default is used
  • user defines delete = True and the file is deleted
  • user defines delete = False and the file is not deleted

The current implementation will fail on the True case.

LOGGER.exception("Could not decompress %s", pathname)
else:
if delete.lower() in ["1", "yes", "true", "on"]:
if delete in ["1", "yes", "true", "on"]:
Copy link
Member

@pnuu pnuu Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work if delete is set to any value that evaluates as boolean True.

@bornagain1981
Copy link
Author

@pnuu I traced all the options (1,yes..) back to True. If I use test_server.py on test folder I have no error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments