def test_bay_show_baymodel_metadata(self, mock_bay, mock_baymodel):
        mock_bay.return_value = mock.MagicMock(baymodel_id=0)
        mock_baymodel.return_value = test_baymodels_shell.FakeBayModel(
            info={'links': 0, 'uuid': 0, 'id': 0, 'name': ''})

        self._test_arg_success('bay-show --long x')
        mock_bay.assert_called_once_with('x')
        mock_baymodel.assert_called_once_with(0)
Example #2
0
    def test_bay_show_baymodel_metadata(self, mock_bay, mock_baymodel):
        mock_bay.return_value = FakeBay(info={'links': 0, 'baymodel_id': 0})
        mock_baymodel.return_value = test_baymodels_shell.FakeBayModel(
            info={
                'links': 0,
                'uuid': 0,
                'id': 0,
                'name': ''
            })

        self._test_arg_success('bay-show --long x', 'baymodel_name')
        self.assertTrue(mock_bay.called)
        self.assertTrue(mock_baymodel.called)