1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
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.assertEqual(deployment.id, "ID")
self.assertEqual(deployment.current_actions[0].app, "/app")
|