Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] Test to create group #10134

Merged
merged 1 commit into from
May 22, 2020

Conversation

dgaikwad
Copy link
Contributor

@dgaikwad dgaikwad commented May 20, 2020

adding_test test to create group if at least one category show_in_console value is No

Purpose or Intent

PRT Run

{{pytest: cfme/tests/configure/test_access_control.py -k "test_create_group_console_no" --long-running -v}}

@dajoRH
Copy link
Contributor

dajoRH commented May 20, 2020

I detected some fixture changes in commit a95929c3858498d483d33851a077e9626b3c3d17

The local fixture local_group is used in the following files:

  • cfme/tests/integration/test_cfme_auth.py
    • local_user
    • test_login_local_group

Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃

@dgaikwad dgaikwad force-pushed the test_create_group_console_no branch from a95929c to d4ec643 Compare May 20, 2020 15:18
@dgaikwad dgaikwad changed the title [WIPTEST] Test to create group [RFR] Test to create group May 20, 2020
Comment on lines 2892 to 2897
@request.addfinalizer
def _cleanup():
if cg.exists:
cg.delete()
if group.exists:
group.delete()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather add these deletion statements right after the creation statements.
something like -

cg = ....
request.addfinalizer(cg.delete_if_exists)
group = ....
request.addfinalizer(group.delete_if_exists)

On a second thought, you can simply use cg.delete and group.delete since there are no other destructive operations performed on either of them.

Copy link
Member

Choose a reason for hiding this comment

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

@valaparthvi @dgaikwad
The BaseEntity class actually has a delete_if_exists method that was written for just such a scenario, please use it here.

@valaparthvi valaparthvi changed the title [RFR] Test to create group [1LP][RFR] Test to create group May 21, 2020
@valaparthvi valaparthvi added the test-automation To be applied on PR's which are automating existing manual cases label May 21, 2020
Copy link
Member

@mshriver mshriver left a comment

Choose a reason for hiding this comment

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

Please use delete_if_exists, optionally in a request.addfinalizer call.

@mshriver mshriver changed the title [1LP][RFR] Test to create group [1LP][WIPTEST] Test to create group May 21, 2020
@dgaikwad dgaikwad force-pushed the test_create_group_console_no branch from d4ec643 to 56755ea Compare May 21, 2020 15:28
@dgaikwad dgaikwad changed the title [1LP][WIPTEST] Test to create group [1LP][RFR] Test to create group May 21, 2020
@mshriver mshriver self-assigned this May 22, 2020
@mshriver mshriver merged commit d34abd2 into ManageIQ:master May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lint-ok test-automation To be applied on PR's which are automating existing manual cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants