File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
tests/functional/network/v2 Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -943,15 +943,12 @@ def take_action(self, parsed_args):
943943 for item in columns
944944 ]
945945
946- headers , attrs = utils .calculate_header_and_attrs (
947- column_headers , columns , parsed_args
948- )
949946 return (
950- headers ,
947+ column_headers ,
951948 (
952949 utils .get_item_properties (
953950 s ,
954- attrs ,
951+ columns ,
955952 formatters = _list_formatters ,
956953 )
957954 for s in data
Original file line number Diff line number Diff line change 1212
1313import uuid
1414
15+ from tempest .lib import exceptions as tempest_exc
16+
1517from openstackclient .tests .functional .network .v2 import common
1618
1719
@@ -162,8 +164,16 @@ def test_port_list(self):
162164 id_list = [p ['ID' ] for p in json_output ]
163165 self .assertIn (id1 , id_list )
164166 self .assertIn (id2 , id_list )
165- # Check an unknown field exists
166- self .assertIn ('device_id' , json_output [0 ])
167+ # Check an unknown field does not exist
168+ self .assertNotIn ('device_id' , json_output [0 ])
169+
170+ # Test list with only unknown fields
171+ exc = self .assertRaises (
172+ tempest_exc .CommandFailed ,
173+ self .openstack ,
174+ 'port list -c device_id' ,
175+ )
176+ self .assertIn ("No recognized column names in ['device_id']" , str (exc ))
167177
168178 def test_port_set (self ):
169179 """Test create, set, show, delete"""
You can’t perform that action at this time.
0 commit comments