summaryrefslogtreecommitdiff
path: root/neutronclient/tests
diff options
context:
space:
mode:
authorMykola Yakovliev <VegasQ@gmail.com>2018-06-08 14:35:36 -0500
committerMykola Yakovliev <myakovliev@mirantis.com>2018-08-31 20:08:57 +0000
commit0aefe1ccba63faa0d0e7131bbbd3331741e3ec2e (patch)
tree149881c992db3ccb370e1c1505f850ce60acb47e /neutronclient/tests
parentf0640571d1d32210c6121763e4222069e6d539f8 (diff)
downloadpython-neutronclient-0aefe1ccba63faa0d0e7131bbbd3331741e3ec2e.tar.gz
Ensure API calls for subnets are in URL length limit
Fix situation when with pagination enabled, neutronclient failed to read subnets information due to too long URI. Change-Id: I53240c536d77a95510b5c83b81e21782f29d886a Closes-Bug: 1775922
Diffstat (limited to 'neutronclient/tests')
-rw-r--r--neutronclient/tests/unit/test_cli20_network.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/neutronclient/tests/unit/test_cli20_network.py b/neutronclient/tests/unit/test_cli20_network.py
index 230c5d4..2f7a468 100644
--- a/neutronclient/tests/unit/test_cli20_network.py
+++ b/neutronclient/tests/unit/test_cli20_network.py
@@ -653,8 +653,12 @@ class CLITestV20ExtendListNetworkJSON(test_cli20.CLITestV20Base):
data = [{'id': 'netid%d' % i, 'name': 'net%d' % i,
'subnets': ['mysubid%d' % i]}
for i in range(10)]
- filters1, response1 = self._build_test_data(data[:len(data) - 1])
- filters2, response2 = self._build_test_data(data[len(data) - 1:])
+ # Since in pagination we add &marker=<uuid> (44 symbols), total change
+ # is 45 symbols. Single subnet takes 40 symbols (id=<uuid>&).
+ # Because of it marker will take more space than single subnet filter,
+ # and we expect neutron to send last 2 subnets in separate response.
+ filters1, response1 = self._build_test_data(data[:len(data) - 2])
+ filters2, response2 = self._build_test_data(data[len(data) - 2:])
path = getattr(self.client, 'subnets_path')
cmd = network.ListNetwork(test_cli20.MyApp(sys.stdout), None)
with mock.patch.object(cmd, "get_client",