File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,8 +49,15 @@ def pytest_addoption(parser):
4949@pytest .fixture
5050def fakeicontrolsession (monkeypatch ):
5151 class Response (object ):
52+ def __init__ (self , ** json_keys ):
53+ if 'selfLink' not in json_keys :
54+ json_keys ['selfLink' ] = \
55+ 'https://localhost/mgmt/tm/sys?ver=11.6.0'
56+ self .params = json_keys
57+
5258 def json (self ):
53- return {'selfLink' : 'https://localhost/mgmt/tm/sys?ver=11.6.0' }
59+ return self .params
60+
5461 fakesessionclass = mock .create_autospec (iControlRESTSession , spec_set = True )
5562 fakesessioninstance = \
5663 mock .create_autospec (iControlRESTSession ('A' , 'B' ), spec_set = True )
@@ -72,7 +79,7 @@ def json(self):
7279 monkeypatch .setattr ('f5.bigip.iControlRESTSession' , fakesessionclass )
7380
7481
75- @pytest .fixture
82+ @pytest .fixture ( scope = 'session' )
7683def opt_bigip (request ):
7784 return request .config .getoption ("--bigip" )
7885
You can’t perform that action at this time.
0 commit comments