def test_cluster_show_clustertemplate_metadata(self, mock_cluster, mock_clustertemplate): mock_cluster.return_value = mock.MagicMock(cluster_template_id=0) mock_clustertemplate.return_value = \ test_clustertemplates_shell.FakeClusterTemplate(info={'links': 0, 'uuid': 0, 'id': 0, 'name': ''}) self._test_arg_success('cluster-show --long x') mock_cluster.assert_called_once_with('x') mock_clustertemplate.assert_called_once_with(0)
def test_cluster_show_clustertemplate_metadata(self, mock_cluster, mock_clustertemplate): mock_cluster.return_value = FakeCluster(info={ 'links': 0, 'baymodel_id': 0 }) mock_clustertemplate.return_value = \ test_clustertemplates_shell.FakeClusterTemplate(info={'links': 0, 'uuid': 0, 'id': 0, 'name': ''}) self._test_arg_success('cluster-show --long x', 'clustertemplate_name') self.assertTrue(mock_cluster.called) self.assertTrue(mock_clustertemplate.called)