diff options
author | Kevin Benton <kevin@benton.pub> | 2017-04-18 01:40:38 -0700 |
---|---|---|
committer | Ihar Hrachyshka <ihrachys@redhat.com> | 2017-04-19 00:23:15 +0000 |
commit | 4d8685da8050df79d9193f91cab572cfc6d67a47 (patch) | |
tree | 953501fb7b8cec69b24c10e5b355caa507239c83 | |
parent | 639e1a46f55cb0ade1b92087ac32f99ff62f0da7 (diff) | |
download | neutron-stable/mitaka.tar.gz |
Ensure behavior of None for device_idmitaka-eolstable/mitaka
A simple unit test to ensure that we have had the same behavior
across releases WRT to explicitly passing None for device_id.
Change-Id: I153f3e1b4258f33c5fa3f16cc30a411052670b30
Related-Bug: #1681784
(cherry picked from commit 84d2d027625e15fdd5cc887c2c8b810e994b7a30)
-rw-r--r-- | neutron/tests/unit/db/test_db_base_plugin_v2.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/neutron/tests/unit/db/test_db_base_plugin_v2.py b/neutron/tests/unit/db/test_db_base_plugin_v2.py index 2578d312fa..7707a9fd03 100644 --- a/neutron/tests/unit/db/test_db_base_plugin_v2.py +++ b/neutron/tests/unit/db/test_db_base_plugin_v2.py @@ -925,6 +925,21 @@ class TestPortsV2(NeutronDbPluginV2TestCase): self.assertIn('mac_address', port['port']) self._delete('ports', port['port']['id']) + def test_create_port_None_values(self): + with self.network() as network: + keys = ['device_owner', 'name', 'device_id'] + for key in keys: + # test with each as None and rest as '' + kwargs = {k: '' for k in keys} + kwargs[key] = None + self._create_port(self.fmt, + network['network']['id'], + webob.exc.HTTPClientError.code, + tenant_id='tenant_id', + fixed_ips=[], + set_context=False, + **kwargs) + def test_create_port_public_network_with_ip(self): with self.network(shared=True) as network: with self.subnet(network=network, cidr='10.0.0.0/24') as subnet: |