Files
python-troveclient/troveclient/tests/osc/v1/fakes.py
Trevor McCasland 808caecc6d Add backup-list to OSC
This change adds database support to the python-openstackclient
project for the backup-list command.

The trove command backup-list is now:
    openstack database backup list

Change-Id: I9aafb76c5a0d4a49b92a356e8465abf5919ab0ac
Partially-Implements: trove-support-in-python-openstackclient
2017-01-17 11:24:09 -06:00

40 lines
1.2 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from troveclient.tests import fakes
from troveclient.tests.osc import utils
from troveclient.v1 import backups
from troveclient.v1 import flavors
class TestDatabasev1(utils.TestCommand):
def setUp(self):
super(TestDatabasev1, self).setUp()
self.app.client_manager.database = mock.MagicMock()
class FakeFlavors(object):
fake_flavors = fakes.FakeHTTPClient().get_flavors()[2]['flavors']
def get_flavors_1(self):
return flavors.Flavor(None, self.fake_flavors[0])
class FakeBackups(object):
fake_backups = fakes.FakeHTTPClient().get_backups()[2]['backups']
def get_backup_bk_1234(self):
return backups.Backup(None, self.fake_backups[0])