1313# limitations under the License.
1414#
1515
16- from pprint import pprint as pp
1716from requests import HTTPError
1817
1918from f5 .bigip .tm .sys .application import Service
2019from f5 .bigip .tm .sys .application import Template
2120
22- pp (__file__ )
2321TESTDESCRIPTION = 'TESTDESCRIPTION'
2422
25- # Application Service Dictionary
23+ # Application service dictionary, which matches JSON structure
2624sections = {
2725 'implementation' : '' ,
2826 'presentation' : ''
@@ -56,20 +54,23 @@ def setup_template_test(request, bigip, name, partition):
5654
5755 def teardown ():
5856 delete_resource (test_template )
57+
5958 request .addfinalizer (teardown )
6059 test_template = template_s .template .create (
6160 name = name ,
6261 partition = partition ,
6362 actions = definition
6463 )
6564 assert isinstance (test_template , Template )
65+ assert id (test_template ) != id (template_s .template )
6666 return template_s , test_template
6767
6868
6969def setup_service_test (request , bigip , name , partition , template_name , tgroup ):
7070 service_s = setup_service_collection_test (request , bigip )
7171
7272 def teardown ():
73+ # Delete the service first, then the template
7374 delete_resource (test_service )
7475 delete_resource (test_template )
7576
@@ -80,13 +81,15 @@ def teardown():
8081 actions = definition
8182 )
8283 assert isinstance (test_template , Template )
84+ assert id (test_template ) != id (template_factory )
8385 test_service = service_s .service .create (
8486 name = name ,
8587 partition = partition ,
8688 template = template_name ,
8789 trafficGroup = tgroup
8890 )
8991 assert isinstance (test_service , Service )
92+ assert id (test_service ) != id (service_s .service )
9093 request .addfinalizer (teardown )
9194 return service_s , test_service
9295
0 commit comments