Beispiel #1
0
 def test_deployments_outputs_json(self):
     outputs = deployments.DeploymentOutputs({
         'deployment_id': 'dep1',
         'outputs': {
             'port': 8080
         }
     })
     deployment = deployments.Deployment({
         'outputs': {
             'port': {
                 'description': 'Webserver port.',
                 'value': '...'
             }
         }
     })
     self.client.deployments.get = MagicMock(return_value=deployment)
     self.client.deployments.outputs.get = MagicMock(return_value=outputs)
     outcome = self.invoke('cfy deployments outputs dep1 --json')
     parsed = json.loads(outcome.output)
     self.assertEqual(
         parsed,
         {'port': {
             'value': 8080,
             'description': 'Webserver port.'
         }})
Beispiel #2
0
    def test_deployments_outputs(self):

        outputs = deployments.DeploymentOutputs({
            'deployment_id': 'dep1',
            'outputs': {
                'port': 8080
            }
        })
        deployment = deployments.Deployment({
            'outputs': {
                'port': {
                    'description': 'Webserver port.',
                    'value': '...'
                }
            }
        })
        self.client.deployments.get = MagicMock(return_value=deployment)
        self.client.deployments.outputs.get = MagicMock(return_value=outputs)
        self.invoke('cfy deployments outputs dep1')