Skip to content
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

Jira V3 - Added missing assert to unit tests #27738

Merged
merged 3 commits into from Jun 26, 2023

Conversation

anas-yousef
Copy link
Contributor

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

fixes: link to the issue

Description

Added missing assert to unit tests, and fixed a unit test.

Screenshots

Paste here any images that will help the reviewer

Minimum version of Cortex XSOAR

  • 6.0.0
  • 6.1.0
  • 6.2.0
  • 6.5.0

Does it break backward compatibility?

  • Yes
    • Further details:
  • No

Must have

  • Tests
  • Documentation

@anas-yousef anas-yousef self-assigned this Jun 26, 2023
@anas-yousef anas-yousef requested a review from dorschw June 26, 2023 15:59
Copy link
Contributor

@dorschw dorschw left a comment

Choose a reason for hiding this comment

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

nice

return json.loads(f.read())


def util_load_bytes_file(path: str):
with io.open(path, mode='rb') as f:
with open(path, mode='rb') as f:
Copy link
Contributor

Choose a reason for hiding this comment

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

the best practice here would be return Path(path).read_bytes(), but maybe not in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can such a suggestion be added using ruff in the pre-commit command?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. For this to happen:

  1. Add this test to flake8-use-pathlib (hope they approve it), let them assign some error code
  2. Use the same error code to suggest this change to Ruff

@anas-yousef anas-yousef merged commit 6fa495e into master Jun 26, 2023
17 checks passed
@anas-yousef anas-yousef deleted the ay-jira-missing-assert-unit-tests branch June 26, 2023 17:52
MosheEichler pushed a commit that referenced this pull request Jul 2, 2023
* Added missing assert to unit tests, and fixed a unit test

* Made changes suggested by ruff
xsoar-bot pushed a commit to xsoar-contrib/content that referenced this pull request Jul 26, 2023
* Added missing assert to unit tests, and fixed a unit test

* Made changes suggested by ruff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants