Skip to content

Commit

Permalink
STY: Changes from black and pylint
Browse files Browse the repository at this point in the history
Made changes from black and pylint linters
  • Loading branch information
khalford committed Jan 16, 2025
1 parent 16e7f66 commit bb1d6f8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cloud-chatops/src/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def parse_args() -> Namespace:
return parser.parse_args()


if __name__ == "__main__": # pragma: no cover
if __name__ == "__main__": # pragma: no cover
arguments = parse_args()
validate_required_files()
main(arguments)
4 changes: 3 additions & 1 deletion cloud-chatops/src/helper/read_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def validate_required_files() -> None:
raise ErrorInConfig(f"Token {token} does not have a value in secrets.yml.")

if not get_token("SLACK_APP_TOKEN") and not get_token("SLACK_SIGNING_SECRET"):
raise ErrorInConfig(f"App requires either SLACK_APP_TOKEN or SLACK_SIGNING_SECRET in secrets.yml. Found neither")
raise ErrorInConfig(
"App requires either SLACK_APP_TOKEN or SLACK_SIGNING_SECRET in secrets.yml. Found neither"
)

if not get_config("repos"):
raise ErrorInConfig("config.yml does not contain any repositories.")
Expand Down
1 change: 1 addition & 0 deletions cloud-chatops/tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def test_run_global_reminder(
mock_get_token.assert_any_call("GITHUB_TOKEN")
mock_get_token.assert_any_call("SLACK_BOT_TOKEN")


# Disable for patching
# pylint: disable=R0917
# pylint: disable=R0913
Expand Down
8 changes: 6 additions & 2 deletions cloud-chatops/tests/test_read_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def test_validate_required_files_fail_repo(mock_get_token, mock_get_config):

@patch("helper.read_config.get_config")
@patch("helper.read_config.get_token")
def test_validate_required_files_fail_token_first_check(mock_get_token, mock_get_config):
def test_validate_required_files_fail_token_first_check(
mock_get_token, mock_get_config
):
"""Test the validate files function"""
mock_get_token.side_effect = ["", "mock_github"]
mock_get_config.side_effect = [{"owner1": ["repo1"]}, {"github1": "slack1"}]
Expand All @@ -143,7 +145,9 @@ def test_validate_required_files_fail_token_first_check(mock_get_token, mock_get

@patch("helper.read_config.get_config")
@patch("helper.read_config.get_token")
def test_validate_required_files_fail_token_second_check(mock_get_token, mock_get_config):
def test_validate_required_files_fail_token_second_check(
mock_get_token, mock_get_config
):
"""Test the validate files function"""
mock_get_token.side_effect = ["mock_bot", "mock_github", "", ""]
mock_get_config.side_effect = [{"owner1": ["repo1"]}, {"github1": "slack1"}]
Expand Down

0 comments on commit bb1d6f8

Please sign in to comment.