-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 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
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,40 @@ | ||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def content_smart_proxy(api, organization): | ||
smart_proxies = api.resource('smart_proxies').call('index', {'sort_by': 'id', 'sort_order': 'DESC'}) | ||
content_proxy = smart_proxies['results'][0] | ||
content_proxy_id = content_proxy['id'] | ||
|
||
environments = api.resource('capsule_content').call('lifecycle_environments', { | ||
'id': content_proxy['id'] | ||
})['results'] | ||
|
||
for environment in environments: | ||
response = api.resource('capsule_content').call('remove_lifecycle_environment', { | ||
'id': content_proxy_id, | ||
'environment_id': environment['id'] | ||
}) | ||
|
||
library = api.resource('lifecycle_environments').call('index', { | ||
'search': 'Library', | ||
'organization_id': organization['id'] | ||
})['results'][0] | ||
|
||
api.resource('capsule_content').call('add_lifecycle_environment', { | ||
'id': content_proxy_id, | ||
'environment_id': library['id'] | ||
}) | ||
|
||
return content_proxy | ||
|
||
@pytest.fixture | ||
def organization(api, entities): | ||
return api.resource('organizations').call('index', { | ||
'search': entities['organization_label'] | ||
})['results'][0] | ||
|
||
|
||
def test_smart_proxy_content_sync(api, content_smart_proxy): | ||
assert api.resource('capsule_content').call('sync', {'id': content_smart_proxy['id']}) |