Skip to content

Commit

Permalink
Matched DistributionTree serializers with the models
Browse files Browse the repository at this point in the history
https://pulp.plan.io/issues/7394
closes #7394

[nocoverage]

(cherry picked from commit 515057f)
  • Loading branch information
fao89 authored and Travis CI User committed Sep 4, 2020
1 parent 3996c35 commit ee70750
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES/7394.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixing OpenAPI schema for Variant
10 changes: 5 additions & 5 deletions pulp_rpm/app/serializers/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ class VariantSerializer(serializers.ModelSerializer):
help_text=_("Relative path to directory with binary RPMs.")
)
source_packages = serializers.CharField(
help_text=_("Relative path to directory with source RPMs.")
help_text=_("Relative path to directory with source RPMs."), allow_null=True
)
source_repository = serializers.CharField(
help_text=_("Relative path to YUM repository with source RPMs.")
help_text=_("Relative path to YUM repository with source RPMs."), allow_null=True
)
debug_packages = serializers.CharField(
help_text=_("Relative path to directory with debug RPMs.")
help_text=_("Relative path to directory with debug RPMs."), allow_null=True
)
debug_repository = serializers.CharField(
help_text=_("Relative path to YUM repository with debug RPMs.")
help_text=_("Relative path to YUM repository with debug RPMs."), allow_null=True
)
identity = serializers.CharField(
help_text=_("Relative path to a pem file that identifies a product.")
help_text=_("Relative path to a pem file that identifies a product."), allow_null=True
)

class Meta:
Expand Down
5 changes: 5 additions & 0 deletions pulp_rpm/tests/functional/api/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
from pulp_rpm.tests.functional.utils import set_up_module as setUpModule # noqa:F401

from pulpcore.client.pulp_rpm import (
ContentDistributionTreesApi,
RepositoriesRpmApi,
RpmRepositorySyncURL,
RemotesRpmApi,
Expand Down Expand Up @@ -254,6 +255,10 @@ def test_kickstarter(self):
# sync again
repo, remote = self.do_test(repository=repo, remote=remote)

# Test distribution tree API
dist_tree_api = ContentDistributionTreesApi(self.client)
self.assertEqual(dist_tree_api.list().results[0].release_short, "RHEL")

# Check that nothing has changed since the last sync.
self.assertDictEqual(get_content_summary(repo.to_dict()), RPM_KICKSTART_FIXTURE_SUMMARY)
self.assertEqual(latest_version_href, repo.latest_version_href)
Expand Down

0 comments on commit ee70750

Please sign in to comment.