File tree Expand file tree Collapse file tree
openstackclient/tests/network/v2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111# under the License.
1212#
1313
14+ import argparse
1415import mock
1516
17+ from openstackclient .api import network_v2
18+ from openstackclient .tests import fakes
19+ from openstackclient .tests import utils
20+
1621extension_name = 'Matrix'
1722extension_namespace = 'http://docs.openstack.org/network/'
1823extension_description = 'Simulated reality'
3338class FakeNetworkV2Client (object ):
3439 def __init__ (self , ** kwargs ):
3540 self .list_extensions = mock .Mock (return_value = {'extensions' : [NETEXT ]})
41+
42+
43+ class TestNetworkV2 (utils .TestCommand ):
44+ def setUp (self ):
45+ super (TestNetworkV2 , self ).setUp ()
46+
47+ self .namespace = argparse .Namespace ()
48+
49+ self .app .client_manager .network = FakeNetworkV2Client (
50+ endpoint = fakes .AUTH_URL ,
51+ token = fakes .AUTH_TOKEN ,
52+ )
53+
54+ self .app .client_manager .network .api = network_v2 .APIv2 (
55+ session = mock .Mock (),
56+ service_type = "network" ,
57+ )
Original file line number Diff line number Diff line change 2020from openstackclient .tests .identity .v2_0 import fakes as identity_fakes_v2
2121from openstackclient .tests .identity .v3 import fakes as identity_fakes_v3
2222from openstackclient .tests .network import common
23+ from openstackclient .tests .network .v2 import fakes as network_fakes
2324
2425RESOURCE = 'network'
2526RESOURCES = 'networks'
5960]
6061
6162
63+ class TestNetwork (network_fakes .TestNetworkV2 ):
64+
65+ def setUp (self ):
66+ super (TestNetwork , self ).setUp ()
67+
68+ # Get a shortcut to the network client
69+ self .network = self .app .client_manager .network
70+
71+ # Get a shortcut to the APIManager
72+ self .api = self .app .client_manager .network .api
73+
74+
6275class TestCreateNetwork (common .TestNetworkBase ):
6376 def test_create_no_options (self ):
6477 arglist = [
You can’t perform that action at this time.
0 commit comments