Merge "fix functional tests for network agents"

This commit is contained in:
Jenkins 2017-01-13 22:18:39 +00:00 committed by Gerrit Code Review
commit 339ab40ee6
3 changed files with 3 additions and 7 deletions

View File

@ -168,7 +168,7 @@ class SetNetworkAgent(command.Command):
def take_action(self, parsed_args):
client = self.app.client_manager.network
obj = client.get_agent(parsed_args.network_agent, ignore_missing=False)
obj = client.get_agent(parsed_args.network_agent)
attrs = {}
if parsed_args.description is not None:
attrs['description'] = str(parsed_args.description)
@ -193,7 +193,7 @@ class ShowNetworkAgent(command.ShowOne):
def take_action(self, parsed_args):
client = self.app.client_manager.network
obj = client.get_agent(parsed_args.network_agent, ignore_missing=False)
obj = client.get_agent(parsed_args.network_agent)
columns = tuple(sorted(list(obj.keys())))
data = utils.get_item_properties(obj, columns, formatters=_formatters,)
return columns, data

View File

@ -10,8 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import testtools
from openstackclient.tests.functional import base
@ -28,13 +26,11 @@ class NetworkAgentTests(base.TestCase):
# get the list of network agent IDs.
cls.IDs = raw_output.split('\n')
@testtools.skip('broken SDK testing')
def test_network_agent_show(self):
opts = self.get_opts(self.FIELDS)
raw_output = self.openstack('network agent show ' + self.IDs[0] + opts)
self.assertEqual(self.IDs[0] + "\n", raw_output)
@testtools.skip('broken SDK testing')
def test_network_agent_set(self):
opts = self.get_opts(['admin_state_up'])
self.openstack('network agent set --disable ' + self.IDs[0])

View File

@ -324,6 +324,6 @@ class TestShowNetworkAgent(TestNetworkAgent):
columns, data = self.cmd.take_action(parsed_args)
self.network.get_agent.assert_called_once_with(
self._network_agent.id, ignore_missing=False)
self._network_agent.id)
self.assertEqual(self.columns, columns)
self.assertEqual(list(self.data), list(data))