Skip to content

Move tests for global helper functions to test_utils.py#1356

Closed
devpatel-1 wants to merge 2 commits into
GreedyBear-Project:mainfrom
devpatel-1:fix/move-tests-to-test-utils-v2
Closed

Move tests for global helper functions to test_utils.py#1356
devpatel-1 wants to merge 2 commits into
GreedyBear-Project:mainfrom
devpatel-1:fix/move-tests-to-test-utils-v2

Conversation

@devpatel-1
Copy link
Copy Markdown

Moved TestGetIocType, TestIsValidIpv4, and TestIsValidCIDR from test_extraction_utils.py to test_utils.py as they test functions from greedybear/utils.py not extraction utils.

Fixes #1352

Description

Please include a short summary of the change. Don't just paste LLM output here.

Related issues

Please add related issues: the issues you are trying to solve as well as other issues that are important in the context of this pull request.

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Chore (refactoring, dependency updates, CI/CD changes, code cleanup, docs-only changes).

Checklist

Please complete this checklist carefully. It helps guide your contribution and lets maintainers verify that all requirements are met.

Formalities

  • I have read and understood the rules about how to Contribute to this project.
  • I chose an appropriate title for the pull request in the form: <feature name>. Closes #999
  • My branch is based on develop.
  • The pull request is for the branch develop.
  • I have reviewed and verified any LLM-generated code included in this PR.

Docs and tests

  • I documented my code changes with docstrings and/or comments.
  • I have checked if my changes affect user-facing behavior that is described in the docs. If so, I also included an update to the wiki in the description of this PR.
  • Linter (Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • I have added tests for the feature/bug I solved.
  • All the tests gave 0 errors.

GUI changes

Ignore this section if you did not make any changes to the GUI.

  • I have provided a screenshot of the result in the PR.
  • I have created new frontend tests for the new component or updated existing ones.

Review process

  • We encourage you to create a draft PR first, even when your changes are incomplete. This way you refine your code while we can track your progress and actively review and help.
  • If you think your draft PR is ready to be reviewed by the maintainers, click the corresponding button. Your draft PR will become a real PR.
  • If your changes decrease the overall tests coverage (you will know after the Codecov CI job is done), you should add the required tests to fix the problem.
  • Every time you make changes to the PR and you think the work is done, you should explicitly ask for a review. After receiving a "change request", address the feedback and click "request re-review" next to the reviewer's profile picture at the top right.

Moved TestGetIocType, TestIsValidIpv4, and TestIsValidCIDR
from test_extraction_utils.py to test_utils.py as they test
functions from greedybear/utils.py not extraction utils.

Fixes #1352
@devpatel-1 devpatel-1 force-pushed the fix/move-tests-to-test-utils-v2 branch from 94ea5de to 2c346d2 Compare May 21, 2026 14:21
Comment thread tests/test_utils.py
@@ -1,11 +1,290 @@
# This file is a part of GreedyBear https://github.com/honeynet/GreedyBear
# Copyright (C) 2021-2022 CSIRT Gadgets Foundation
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is this? :D

Comment thread tests/test_utils.py
is_valid_ipv4,
)

from .base import CustomTestCase
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's not the correct path, so the code in your PR is not executable. This means you never ran the suite locally after the move. Or do you have another explanation?

@devpatel-1 devpatel-1 closed this May 22, 2026
@regulartim
Copy link
Copy Markdown
Member

Hey @devpatel-1 ! You did not answer my feedback on your PR and just closed it. That's not how I expect contributors to collaborate. I'll unassign you from the issue.

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.

Move tests for global helper functions

2 participants