diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-01-22 08:55:38 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-01-22 08:55:38 +0000 |
| commit | 75caafa0965617023f8dfba3be5a53e6711eecce (patch) | |
| tree | 8c76dba09a4b708437b6b9442c40d85c48d0fd74 /openstackclient/tests/volume/v2/test_snapshot.py | |
| parent | 59b1bb10d676eddfdd9e9f9e8075fd312bd9f941 (diff) | |
| parent | 604d8589ee0634af6f3f44c8579ff7ddaceb407d (diff) | |
| download | python-openstackclient-75caafa0965617023f8dfba3be5a53e6711eecce.tar.gz | |
Merge "Refactor: Abstract columns and datalist out in volume test cases"
Diffstat (limited to 'openstackclient/tests/volume/v2/test_snapshot.py')
| -rw-r--r-- | openstackclient/tests/volume/v2/test_snapshot.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/openstackclient/tests/volume/v2/test_snapshot.py b/openstackclient/tests/volume/v2/test_snapshot.py index 3b30d4ef..1c1dd437 100644 --- a/openstackclient/tests/volume/v2/test_snapshot.py +++ b/openstackclient/tests/volume/v2/test_snapshot.py @@ -202,6 +202,15 @@ class TestSnapshotUnset(TestSnapshot): class TestSnapshotList(TestSnapshot): + + columns = [ + "ID", + "Name", + "Description", + "Status", + "Size" + ] + def setUp(self): super(TestSnapshotList, self).setUp() @@ -231,8 +240,7 @@ class TestSnapshotList(TestSnapshot): parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = self.cmd.take_action(parsed_args) - collist = ["ID", "Name", "Description", "Status", "Size"] - self.assertEqual(collist, columns) + self.assertEqual(self.columns, columns) datalist = (( volume_fakes.snapshot_id, volume_fakes.snapshot_name, @@ -249,9 +257,12 @@ class TestSnapshotList(TestSnapshot): columns, data = self.cmd.take_action(parsed_args) - collist = ["ID", "Name", "Description", "Status", "Size", "Created At", - "Volume", "Properties"] - self.assertEqual(collist, columns) + columns = self.columns + [ + "Created At", + "Volume", + "Properties" + ] + self.assertEqual(columns, columns) datalist = (( volume_fakes.snapshot_id, @@ -277,14 +288,7 @@ class TestSnapshotList(TestSnapshot): columns, data = self.cmd.take_action(parsed_args) - collist = [ - "ID", - "Name", - "Description", - "Status", - "Size" - ] - self.assertEqual(collist, columns) + self.assertEqual(self.columns, columns) datalist = (( volume_fakes.snapshot_id, |
