Skip to content

Issue 7284 - Automated test for creating local password policy with i…#7608

Open
mirielka wants to merge 1 commit into
389ds:mainfrom
mirielka:pwpolicy_invalid_attributes
Open

Issue 7284 - Automated test for creating local password policy with i…#7608
mirielka wants to merge 1 commit into
389ds:mainfrom
mirielka:pwpolicy_invalid_attributes

Conversation

@mirielka

@mirielka mirielka commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

…ncorrect passwordInHistory value

Description:
Adding automated test for creating local password policy with incorrect passwordInHistory value

Relates: #7284
Author: Lenka Doudova
Assisted by: Cursor
Reviewer: ???

Summary by Sourcery

Tests:

  • Introduce a parametrized test validating accepted and rejected passwordInHistory values when creating subtree local password policies, marking known incorrect behaviors as expected failures.

…ncorrect passwordInHistory value

Description:
Adding automated test for creating local password policy with incorrect passwordInHistory value

Relates: 389ds#7284
Author: Lenka Doudova
Assisted by: Cursor
Reviewer: ???
@mirielka mirielka force-pushed the pwpolicy_invalid_attributes branch from fcdb837 to 3e9b86b Compare June 25, 2026 10:06

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The parametrized values for passwordInHistory all repeat the issue URL in multiple xfail marks; consider defining a shared mark or constant for the bug reference to avoid duplication and make future updates easier.
  • The nested try/except/finally block in test_create_local_pwp_with_passwordInHistory is a bit complex; you could simplify cleanup by extracting it into a helper or fixture that consistently handles local policy and container deletion.
  • To improve readability of the parametrized test, consider adding ids to pytest.mark.parametrize so each case is clearly labeled (e.g., 'valid-0', 'valid-24', 'invalid-negative', etc.).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The parametrized values for `passwordInHistory` all repeat the issue URL in multiple `xfail` marks; consider defining a shared mark or constant for the bug reference to avoid duplication and make future updates easier.
- The nested try/except/finally block in `test_create_local_pwp_with_passwordInHistory` is a bit complex; you could simplify cleanup by extracting it into a helper or fixture that consistently handles local policy and container deletion.
- To improve readability of the parametrized test, consider adding `ids` to `pytest.mark.parametrize` so each case is clearly labeled (e.g., 'valid-0', 'valid-24', 'invalid-negative', etc.).

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@packit-as-a-service

Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/389ds-389-ds-base-7608
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

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.

1 participant