1313# limitations under the License.
1414#
1515
16- from pprint import pprint as pp
1716from requests import HTTPError
1817
19- pp (__file__ )
18+ from f5 .bigip .tm .sys .application import Service
19+ from f5 .bigip .tm .sys .application import Template
20+
2021TESTDESCRIPTION = 'TESTDESCRIPTION'
2122
22- # Application Service Dictionary
23+ # Application service dictionary, which matches JSON structure
2324sections = {
2425 'implementation' : '' ,
2526 'presentation' : ''
@@ -53,19 +54,23 @@ def setup_template_test(request, bigip, name, partition):
5354
5455 def teardown ():
5556 delete_resource (test_template )
57+
5658 request .addfinalizer (teardown )
5759 test_template = template_s .template .create (
5860 name = name ,
5961 partition = partition ,
6062 actions = definition
6163 )
64+ assert isinstance (test_template , Template )
65+ assert id (test_template ) != id (template_s .template )
6266 return template_s , test_template
6367
6468
6569def setup_service_test (request , bigip , name , partition , template_name , tgroup ):
6670 service_s = setup_service_collection_test (request , bigip )
6771
6872 def teardown ():
73+ # Delete the service first, then the template
6974 delete_resource (test_service )
7075 delete_resource (test_template )
7176
@@ -75,12 +80,16 @@ def teardown():
7580 partition = partition ,
7681 actions = definition
7782 )
83+ assert isinstance (test_template , Template )
84+ assert id (test_template ) != id (template_factory )
7885 test_service = service_s .service .create (
7986 name = name ,
8087 partition = partition ,
8188 template = template_name ,
8289 trafficGroup = tgroup
8390 )
91+ assert isinstance (test_service , Service )
92+ assert id (test_service ) != id (service_s .service )
8493 request .addfinalizer (teardown )
8594 return service_s , test_service
8695
0 commit comments