Skip to content

Commit

Permalink
Add proxy sync test
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Dec 14, 2020
1 parent 2728047 commit 26802b2
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/test_smart_proxy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import pytest


@pytest.fixture
def content_smart_proxy(api, organization):
content_proxy_id = '2'
content_proxy = api.resource('smart_proxies').call('show', {'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']})

0 comments on commit 26802b2

Please sign in to comment.