Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindings tests #150

Merged
merged 2 commits into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flake8.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
exclude = ./docs/*,*/migrations/*
ignore = W503,Q000,D100,D104,D106,D200,D401,D402,D202
ignore = W503,Q000,D100,D104,D106,D200,D401,D402,E203
max-line-length = 100

# Flake8-quotes extension codes
Expand All @@ -16,4 +16,4 @@ max-line-length = 100
# D200: one-line docstring should fit on one line with quotes
# D401: first line should be imperative (nitpicky)
# D402: first line should not be the function’s “signature” (false positives)
# D202: no blank line after docstring--disabled until https://github.com/PyCQA/pydocstyle/issues/361 is fixed
# E203: no whitespace around ':'. disabled until https://github.com/PyCQA/pycodestyle/issues/373 is fixed
2 changes: 1 addition & 1 deletion functest_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
git+https://github.com/PulpQE/pulp-smash.git#egg=pulp-smash
git+https://github.com/pulp/pulp-smash.git#egg=pulp-smash
pytest
6 changes: 1 addition & 5 deletions pulp_deb/app/serializers/content_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class GenericContentSerializer(SingleArtifactContentUploadSerializer, ContentChe

def deferred_validate(self, data):
"""Validate the GenericContent data."""

data = super().deferred_validate(data)

data["sha256"] = data["artifact"].sha256
Expand Down Expand Up @@ -389,13 +388,12 @@ def __init__(self, *args, **kwargs):

def deferred_validate(self, data):
"""Validate that the artifact is a package and extract it's values."""

data = super().deferred_validate(data)

try:
package_paragraph = debfile.DebFile(fileobj=data["artifact"].file).debcontrol()
except Exception: # TODO: Be more specific
raise ValidationError(_("Not a valid Deb Package"))
raise ValidationError(_("Unable to read Deb Package"))

from822_serializer = self.Meta.from822_serializer.from822(data=package_paragraph)
from822_serializer.is_valid(raise_exception=True)
Expand Down Expand Up @@ -469,7 +467,6 @@ class PackageSerializer(BasePackageSerializer):

def deferred_validate(self, data):
"""Validate for 'normal' Package (not installer)."""

data = super().deferred_validate(data)

if data.get("section") == "debian-installer":
Expand All @@ -489,7 +486,6 @@ class InstallerPackageSerializer(BasePackageSerializer):

def deferred_validate(self, data):
"""Validate for InstallerPackage."""

data = super().deferred_validate(data)

if data.get("section") != "debian-installer":
Expand Down
Loading