Skip to content

Commit

Permalink
Renaming RepositoryVersion fields
Browse files Browse the repository at this point in the history
_versions_href to versions_href
_latest_version_href to latest_version_href

ref #5548
https://pulp.plan.io/issues/5548

Required PR: pulp/pulpcore#329
Required PR: pulp/pulp-smash#1221
  • Loading branch information
fao89 committed Oct 10, 2019
1 parent 4e8cd5e commit 68eebe2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES/5548.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove "_" from `_versions_href`, `_latest_version_href`
4 changes: 2 additions & 2 deletions docs/workflows/sync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Repository GET Response::
{
"pulp_created": "2019-04-29T15:57:59.763712Z",
"pulp_href": "/pulp/api/v3/repositories/1b2b0af1-5588-4b4b-b2f6-cdd3a3e1cd36/",
"_latest_version_href": null,
"_versions_href": "/pulp/api/v3/repositories/1b2b0af1-5588-4b4b-b2f6-cdd3a3e1cd36/versions/",
"latest_version_href": null,
"versions_href": "/pulp/api/v3/repositories/1b2b0af1-5588-4b4b-b2f6-cdd3a3e1cd36/versions/",
"description": "",
"name": "foo"
}
Expand Down
2 changes: 1 addition & 1 deletion pulp_python/tests/functional/api/test_crud_publications.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_01_all(self):
repo = self.client.get(repo['pulp_href'])
for python_content in get_content(repo)[PYTHON_CONTENT_NAME]:
self.client.post(
repo['_versions_href'],
repo['versions_href'],
{'add_content_units': [python_content['pulp_href']]}
)
versions = get_versions(repo)
Expand Down
8 changes: 4 additions & 4 deletions pulp_python/tests/functional/api/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,20 @@ def test_sync(self):
self.addCleanup(self.client.delete, remote['pulp_href'])

# Sync the repository.
self.assertIsNone(repo['_latest_version_href'])
self.assertIsNone(repo['latest_version_href'])
sync(self.cfg, remote, repo)
repo = self.client.get(repo['pulp_href'])

self.assertIsNotNone(repo['_latest_version_href'])
self.assertIsNotNone(repo['latest_version_href'])
self.assertDictEqual(get_content_summary(repo), PYTHON_XS_FIXTURE_SUMMARY)
self.assertDictEqual(get_added_content_summary(repo), PYTHON_XS_FIXTURE_SUMMARY)

# Sync the repository again.
latest_version_href = repo['_latest_version_href']
latest_version_href = repo['latest_version_href']
sync(self.cfg, remote, repo)
repo = self.client.get(repo['pulp_href'])

self.assertNotEqual(latest_version_href, repo['_latest_version_href'])
self.assertNotEqual(latest_version_href, repo['latest_version_href'])
self.assertDictEqual(get_content_summary(repo), PYTHON_XS_FIXTURE_SUMMARY)
self.assertDictEqual(get_added_content_summary(repo), {})

Expand Down

0 comments on commit 68eebe2

Please sign in to comment.