Refactor TestCreateNetwork: Split TestCreateNetwork into two classes for identity v2 and v3
In TestCreateNetwork, both Identity v2 and v3 clients are tested. As a result, we should initialize the identity client again and again in each test function. To reduce redundant code, this patch split TestCreateNetwork to TestCreateNetworkIdentityV2 and V3. And then initialize the identity client only once in each of them. Change-Id: I349fe7f827524beb541efe7dd9460c534254b80c Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
This commit is contained in:
@@ -72,7 +72,11 @@ class TestNetwork(network_fakes.TestNetworkV2):
|
|||||||
self.api = self.app.client_manager.network.api
|
self.api = self.app.client_manager.network.api
|
||||||
|
|
||||||
|
|
||||||
class TestCreateNetwork(common.TestNetworkBase):
|
class TestCreateNetworkIdentityV3(TestNetwork):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super(TestCreateNetworkIdentityV3, self).setUp()
|
||||||
|
|
||||||
def test_create_no_options(self):
|
def test_create_no_options(self):
|
||||||
arglist = [
|
arglist = [
|
||||||
FAKE_NAME,
|
FAKE_NAME,
|
||||||
@@ -174,6 +178,12 @@ class TestCreateNetwork(common.TestNetworkBase):
|
|||||||
})
|
})
|
||||||
self.assertEqual(FILTERED, result)
|
self.assertEqual(FILTERED, result)
|
||||||
|
|
||||||
|
|
||||||
|
class TestCreateNetworkIdentityV2(TestNetwork):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super(TestCreateNetworkIdentityV2, self).setUp()
|
||||||
|
|
||||||
def test_create_with_project_identityv2(self):
|
def test_create_with_project_identityv2(self):
|
||||||
arglist = [
|
arglist = [
|
||||||
"--project", identity_fakes_v2.project_name,
|
"--project", identity_fakes_v2.project_name,
|
||||||
|
Reference in New Issue
Block a user