-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from larsks/fix/resourceversion
Remove unnecessary metadata from openshift objects
- Loading branch information
Showing
3 changed files
with
63 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
tests/unit/moc_openshift/test_moc_openshift_clean_metadata.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# pylint: disable=missing-module-docstring | ||
import pytest | ||
|
||
import acct_mgt.moc_openshift | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"data,expected", | ||
[ | ||
({}, {}), | ||
({"spec": "test"}, {"spec": "test"}), | ||
({"metadata": {}, "spec": "something"}, {"metadata": {}, "spec": "something"}), | ||
( | ||
{"metadata": {"resourceVersion": "1"}, "spec": "something"}, | ||
{"metadata": {}, "spec": "something"}, | ||
), | ||
( | ||
{ | ||
"metadata": { | ||
"resourceVersion": "1", | ||
"uid": "", | ||
"creationTimestamp": "", | ||
"name": "test", | ||
}, | ||
"spec": "something", | ||
}, | ||
{"metadata": {"name": "test"}, "spec": "something"}, | ||
), | ||
], | ||
) | ||
def test_clean_openshift_metadata(data, expected): | ||
assert acct_mgt.moc_openshift.clean_openshift_metadata(data) == expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters