blob: 39b94a64c7b098faa32d96f42d7c525f54f052e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
from textwrap import dedent
from tasks 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
|