summaryrefslogtreecommitdiff
path: root/openstackclient/tests/compute/v2/fakes.py
diff options
context:
space:
mode:
authorTang Chen <chen.tang@easystack.cn>2016-02-07 02:38:09 +0800
committerTang Chen <chen.tang@easystack.cn>2016-02-07 02:38:09 +0800
commitfc708c4991c6191ca684dca194420a93fdc4a35e (patch)
tree632d1c9854edc0113c72df30bf0fca0087152423 /openstackclient/tests/compute/v2/fakes.py
parent713ed598a4503e7d4c538a7c822a1b00faa11baa (diff)
downloadpython-openstackclient-fc708c4991c6191ca684dca194420a93fdc4a35e.tar.gz
Add unit tests for "hypervisor show" command
Change-Id: Ib75e5eb5b197e9d58fb87a595a43b8774b7b1987
Diffstat (limited to 'openstackclient/tests/compute/v2/fakes.py')
-rw-r--r--openstackclient/tests/compute/v2/fakes.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/openstackclient/tests/compute/v2/fakes.py b/openstackclient/tests/compute/v2/fakes.py
index 1a876a22..ae6d9f5d 100644
--- a/openstackclient/tests/compute/v2/fakes.py
+++ b/openstackclient/tests/compute/v2/fakes.py
@@ -88,6 +88,8 @@ SERVICE = {
class FakeComputev2Client(object):
def __init__(self, **kwargs):
+ self.aggregates = mock.Mock()
+ self.aggregates.resource_class = fakes.FakeResource(None, {})
self.availability_zones = mock.Mock()
self.availability_zones.resource_class = fakes.FakeResource(None, {})
self.images = mock.Mock()
@@ -158,6 +160,30 @@ class FakeHypervisor(object):
hypervisor_info = {
'id': 'hypervisor-id-' + uuid.uuid4().hex,
'hypervisor_hostname': 'hypervisor-hostname-' + uuid.uuid4().hex,
+ 'status': 'enabled',
+ 'host_ip': '192.168.0.10',
+ 'cpu_info': {
+ 'aaa': 'aaa',
+ },
+ 'free_disk_gb': 50,
+ 'hypervisor_version': 2004001,
+ 'disk_available_least': 50,
+ 'local_gb': 50,
+ 'free_ram_mb': 1024,
+ 'service': {
+ 'host': 'aaa',
+ 'disabled_reason': None,
+ 'id': 1,
+ },
+ 'vcpus_used': 0,
+ 'hypervisor_type': 'QEMU',
+ 'local_gb_used': 0,
+ 'vcpus': 4,
+ 'memory_mb_used': 512,
+ 'memory_mb': 1024,
+ 'current_workload': 0,
+ 'state': 'up',
+ 'running_vms': 0,
}
# Overwrite default attributes.