mirror of
https://github.com/ceph/ceph
synced 2025-01-20 18:21:57 +00:00
Add unit test for task.devstack.parse_os_table()
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
This commit is contained in:
parent
5411613599
commit
ca600a2e04
0
teuthology/task/test/__init__.py
Normal file
0
teuthology/task/test/__init__.py
Normal file
48
teuthology/task/test/test_devstack.py
Normal file
48
teuthology/task/test/test_devstack.py
Normal file
@ -0,0 +1,48 @@
|
||||
from textwrap import dedent
|
||||
|
||||
from .. import devstack
|
||||
|
||||
|
||||
class TestDevstack(object):
|
||||
def test_parse_os_table(self):
|
||||
table_str = dedent("""
|
||||
+---------------------+--------------------------------------+
|
||||
| Property | Value |
|
||||
+---------------------+--------------------------------------+
|
||||
| attachments | [] |
|
||||
| availability_zone | nova |
|
||||
| bootable | false |
|
||||
| created_at | 2014-02-21T17:14:47.548361 |
|
||||
| display_description | None |
|
||||
| display_name | NAME |
|
||||
| id | ffdbd1bb-60dc-4d95-acfe-88774c09ad3e |
|
||||
| metadata | {} |
|
||||
| size | 1 |
|
||||
| snapshot_id | None |
|
||||
| source_volid | None |
|
||||
| status | creating |
|
||||
| volume_type | None |
|
||||
+---------------------+--------------------------------------+
|
||||
""").strip()
|
||||
expected = {
|
||||
'Property': 'Value',
|
||||
'attachments': '[]',
|
||||
'availability_zone': 'nova',
|
||||
'bootable': 'false',
|
||||
'created_at': '2014-02-21T17:14:47.548361',
|
||||
'display_description': 'None',
|
||||
'display_name': 'NAME',
|
||||
'id': 'ffdbd1bb-60dc-4d95-acfe-88774c09ad3e',
|
||||
'metadata': '{}',
|
||||
'size': '1',
|
||||
'snapshot_id': 'None',
|
||||
'source_volid': 'None',
|
||||
'status': 'creating',
|
||||
'volume_type': 'None'}
|
||||
|
||||
vol_info = devstack.parse_os_table(table_str)
|
||||
assert vol_info == expected
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user