-
Notifications
You must be signed in to change notification settings - Fork 77
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
Added more informative errors upon failures of the *upload* command #310
Conversation
Pull Request Test Coverage Report for Build 2143
💛 - Coveralls |
@@ -31,19 +31,26 @@ def upload(self): | |||
except IndexError: | |||
print_color('Error: Path input is not a valid package directory.', LOG_COLORS.RED) | |||
return 1 | |||
|
|||
except Exception as err: | |||
print_color(str(err), LOG_COLORS.RED) |
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.
why not print_error
?
except Exception as ex: | ||
raise ex | ||
except Exception as err: | ||
print_color(str(err), LOG_COLORS.RED) |
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.
why not print_error
?
|
||
|
||
@patch('demisto_client.configure') | ||
def test_upload(mocked_configure=None): |
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.
separate into two steps with indicative names:
test_upload_sanity
test_upload_invalid_server
or test_upload_failure
optimal test: checking that an error is printed
you can try to mock print_color
and check that the failure actually calls that function. I tried to in the past and it didn't work so I wouldn't have wasted time on it...
Status
Ready
Related Issues
fixes: https://github.com/demisto/etc/issues/23116
Description
in the issue