Skip to content

Commit

Permalink
Checkin.
Browse files Browse the repository at this point in the history
No-Issue

Signed-off-by: James Tanner <[email protected]>
  • Loading branch information
jctanner committed Oct 21, 2023
1 parent 7992c5b commit 6c9bc91
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
1 change: 1 addition & 0 deletions galaxy_ng/app/api/v1/viewsets/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def update(self, request, pk=None):
# only save if changes made
if changed:
role.save()
return Response(changed, status=200)

return Response(changed, status=204)

Expand Down
51 changes: 50 additions & 1 deletion galaxy_ng/tests/integration/community/test_role_edits.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,54 @@ def test_community_legacy_role_edit(ansible_config):
args={'github_branch': 'fakebranch'}
)
newds = admin_client(f'/api/v1/roles/{role_id}/')
assert newds['github_branch'] == 'fakebranch'

import epdb; epdb.st()
# change the github_user ...
admin_client(
f'/api/v1/roles/{role_id}/',
method='PUT',
args={'github_user': 'fakeuser'}
)
newds = admin_client(f'/api/v1/roles/{role_id}/')
assert newds['github_user'] == 'fakeuser'

# change the github_repo ...
admin_client(
f'/api/v1/roles/{role_id}/',
method='PUT',
args={'github_repo': 'fakerepo'}
)
newds = admin_client(f'/api/v1/roles/{role_id}/')
assert newds['github_repo'] == 'fakerepo'

# change the repository.name ...
admin_client(
f'/api/v1/roles/{role_id}/',
method='PUT',
args={
'repository': {
'name': 'foorepo'
}
}
)
newds = admin_client(f'/api/v1/roles/{role_id}/')
assert newds['summary_fields']['repository']['name'] == 'foorepo'

# change the repository.original_name ...
admin_client(
f'/api/v1/roles/{role_id}/',
method='PUT',
args={
'repository': {
'original_name': 'foorepo_old'
}
}
)
newds = admin_client(f'/api/v1/roles/{role_id}/')
assert newds['summary_fields']['repository']['original_name'] == 'foorepo_old'

# cleanup the role ...
try:
admin_client(f'/api/v1/roles/{role_id}/', method='DELETE')
except Exception as e:
pass

0 comments on commit 6c9bc91

Please sign in to comment.