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

remove code duplication of code dealing with cluster identifier #229

Open
mbukatov opened this issue Jan 11, 2019 · 1 comment
Open

remove code duplication of code dealing with cluster identifier #229

mbukatov opened this issue Jan 11, 2019 · 1 comment

Comments

@mbukatov
Copy link
Contributor

Lot of test functions starts with:

    if cluster_reuse["short_name"]:
        cluster_identifier = cluster_reuse["short_name"]
    else:
        cluster_identifier = cluster_reuse["integration_id"]

and such code duplication is not good.

Instead of copy pasting this code in all tests, value of cluster_reuse fixture should be a object of GlusterCluster class, which will have a method cluster_identifier() which will do what this code does.

@mbukatov mbukatov changed the title Create function remove code duplication of code dealing with cluster identifier Jan 11, 2019
@mbukatov
Copy link
Contributor Author

This could be done with attrs or dataclassess, but latter is available since python 3.7 and we are still on 3.6.

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

No branches or pull requests

1 participant