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

Added more tests to test_http_analyzer.py #572

Merged
merged 9 commits into from
May 28, 2024

Conversation

Sekhar-Kumar-Dash
Copy link
Contributor

Fixes Issue #571

This pull request adds more tests for http_analyzer.py

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

@Sekhar-Kumar-Dash Sekhar-Kumar-Dash changed the base branch from master to develop April 24, 2024 08:58
@Sekhar-Kumar-Dash
Copy link
Contributor Author

Sekhar-Kumar-Dash commented Apr 24, 2024

Hey @AlyaGomaa Will this be enough? It is not showing a PEP8 error in PyCharm. Please tell me if further shortening of lines is required.

@AlyaGomaa
Copy link
Collaborator

AlyaGomaa commented Apr 29, 2024

Hello @Sekhar-Kumar-Dash thanks for reformatting your code and the awesome PR!

quick question, are pre-commit hooks working for you?
i'm getting the following errors preventing me from commiting your code. they're duplicate functions
image

you can install them using

  1. python3 -m pip install pre-commit
  2. pre-commit install (this will install the hooks in the .pre-commit-config.yaml in slips repo)

i highly recommend you set them up in pycharm like so
https://stackoverflow.com/questions/76062147/how-to-run-pre-commit-on-current-active-file-in-pycharm/76067185#76067185
now pycharm will reject commits with issues until you fix them, and sometimes it will re-format your commits automatically so you woudn't have to waste time on code formatting.

@AlyaGomaa AlyaGomaa closed this Apr 29, 2024
@AlyaGomaa AlyaGomaa reopened this Apr 29, 2024
@Sekhar-Kumar-Dash
Copy link
Contributor Author

Hey @AlyaGomaa , thank you for this great suggestion. I am working on it. I will let you know.

@Sekhar-Kumar-Dash
Copy link
Contributor Author

Sekhar-Kumar-Dash commented Apr 30, 2024

Hey @AlyaGomaa , I just removed the duplicates manually as I'm having some issues running the pre-commit right now. Please take a look

Copy link
Collaborator

@AlyaGomaa AlyaGomaa left a comment

Choose a reason for hiding this comment

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

Hey @Sekhar-Kumar-Dash Thanks for your PR!
i added a few comments, and will re-review once they're resolved.
also remember to pull my commits before making more modifications to this PR.
thanksss!

tests/test_http_analyzer.py Show resolved Hide resolved
tests/test_http_analyzer.py Show resolved Hide resolved
tests/test_http_analyzer.py Show resolved Hide resolved
],
)
def test_read_configuration(mock_db, mocker, config_value, expected_exception):
http_analyzer = ModuleFactory().create_http_analyzer_obj(mock_db)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it better to have the 2 cases as different functions? i think we're testing 2 different behaviours using 1 function.
for example test_read_configuration_valid, and test_read_configuration_with_exception would be better

tests/test_http_analyzer.py Show resolved Hide resolved
tests/test_http_analyzer.py Outdated Show resolved Hide resolved
tests/test_http_analyzer.py Outdated Show resolved Hide resolved
tests/test_http_analyzer.py Show resolved Hide resolved
@Sekhar-Kumar-Dash
Copy link
Contributor Author

hey @AlyaGomaa just made the changes please review it

@AlyaGomaa
Copy link
Collaborator

hey @Sekhar-Kumar-Dash thanks for the changes, i think everything looks good now, i'll merge once the tests pass!
keep up the great work!

@AlyaGomaa AlyaGomaa merged commit c924bc3 into stratosphereips:develop May 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants