Skip to content

Fix deserialization for Deploment model#275

Closed
gabber12 wants to merge 3 commits intothefactory:masterfrom
gabber12:master
Closed

Fix deserialization for Deploment model#275
gabber12 wants to merge 3 commits intothefactory:masterfrom
gabber12:master

Conversation

@gabber12
Copy link
Copy Markdown
Contributor

No description provided.

@solarkennedy
Copy link
Copy Markdown
Contributor

I don't know why this is "new", but on py36 tests can you fix:

toolbelt==0.9.1,urllib3==1.25.9,zipp==3.1.0

pep8 run-test-pre: PYTHONHASHSEED='210895343'

pep8 run-test: commands[0] | flake8 .

./tests/test_model_deployment.py:11:26: E225 missing whitespace around operator

./tests/test_model_deployment.py:11:161: E501 line too long (330 > 160 characters)

./tests/test_model_deployment.py:12:1: W293 blank line contains whitespace

./tests/test_model_deployment.py:16:1: W391 blank line at end of file

ERROR: InvocationError for command /home/travis/build/thefactory/marathon-python/.tox/pep8/bin/flake8 . (exited with code 1)

@missingcharacter
Copy link
Copy Markdown
Contributor

@solarkennedy would this be enough?

from marathon.models.deployment import MarathonDeployment
import unittest


class MarathonDeploymentTest(unittest.TestCase):

    def test_env_defaults_to_empty_dict(self):
        """
        é testé
        """
        deployment_json = {
                "id": "ID",
                "version": "2020-05-30T07:35:04.695Z",
                "affectedApps": ["/app"],
                "affectedPods": [],
                "steps": [{
                    "actions": [{
                        "action": "RestartApplication",
                        "app": "/app"
                    }]
                }],
                "currentActions": [{
                    "action": "RestartApplication",
                    "app": "/app",
                    "readinessCheckResults": []
                }],
                "currentStep": 1,
                "totalSteps": 1
        }

        deployment = MarathonDeployment.from_json(deployment_json)
        self.assertEquals(deployment.id, "ID")
        self.assertEquals(deployment.current_actions[0].app, "/app")

@solarkennedy
Copy link
Copy Markdown
Contributor

I can't quite tell, but just do what flake8 wants to make the build green?

@missingcharacter
Copy link
Copy Markdown
Contributor

I'm closing this one in favor of #276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants