File: test_model_deployment.py

package info (click to toggle)
python-marathon 0.13.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: python: 1,969; makefile: 185; sh: 58
file content (33 lines) | stat: -rw-r--r-- 1,053 bytes parent folder | download
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")