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

create controller_managed_device_groups #432

Open
wants to merge 32 commits into
base: develop
Choose a base branch
from

Conversation

pugnacity
Copy link
Contributor

@pugnacity pugnacity commented Oct 1, 2024

This should fix #423

@pugnacity pugnacity marked this pull request as ready for review October 2, 2024 10:02
that:
- test_two['changed']
- test_two['controller_managed_device_group']['name'] == "Test Controller Group One"

Copy link
Contributor

Choose a reason for hiding this comment

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

For the integration tests, we try and stick to a pattern like this:

  • Create with minimal required fields
  • Try and create again to verify idempotency
  • Create a second object with all fields
  • Try and create again to verify idempotency
  • Update one of the previous objects
  • Try and update again to verify idempotency
  • Delete one of the previous objects
  • Try and delete again to verify idempotency

Please refactor your tests to follow this pattern.

plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/device.py Show resolved Hide resolved
plugins/modules/device.py Show resolved Hide resolved
tasks.py Outdated Show resolved Hide resolved
url: "{{ nautobot_url }}"
token: "{{ nautobot_token }}"
name: Test Controller Group One
weight: 2000
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please add an assertion to validate that this field did indeed change?

- test_three['changed']
- test_three['controller_managed_device_group']['name'] == "Test Controller Group One"
- test_three['msg'] == "controller_managed_device_group Test Controller Group One updated"

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a duplicate update test to verify idempotency

plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/controller_managed_device_group.py Outdated Show resolved Hide resolved
plugins/modules/device.py Outdated Show resolved Hide resolved
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.

New Model: Managed Device Group
2 participants