@@ -39,13 +39,19 @@ def setUp(self):
3939 else :
4040 logging .debug ("App %s already exists. Skipping creation." , self .app_name )
4141
42- class TestAppIntegrity (TestApp ):
42+ @classmethod
43+ def tearDownClass (cls ):
44+ import splunklib .client as client
45+ service = client .connect (** cls .opts .kwargs )
46+ for app in service .apps :
47+ if app .name .startswith ('delete-me' ):
48+ service .apps .delete (app .name )
49+
4350 def test_app_integrity (self ):
4451 self .check_entity (self .app )
4552 self .app .setupInfo
4653 self .app ['setupInfo' ]
4754
48- class TestDisableEnable (TestApp ):
4955 def test_disable_enable (self ):
5056 self .app .disable ()
5157 self .app .refresh ()
@@ -54,7 +60,6 @@ def test_disable_enable(self):
5460 self .app .refresh ()
5561 self .assertEqual (self .app ['disabled' ], '0' )
5662
57- class TestUpdate (TestApp ):
5863 def test_update (self ):
5964 kwargs = {
6065 'author' : "Me" ,
@@ -70,22 +75,19 @@ def test_update(self):
7075 self .assertEqual (self .app ['manageable' ], "0" )
7176 self .assertEqual (self .app ['visible' ], "1" )
7277
73- class TestDelete (TestApp ):
7478 def test_delete (self ):
7579 name = testlib .tmpname ()
7680 app = self .service .apps .create (name )
7781 self .assertTrue (name in self .service .apps )
7882 self .service .apps .delete (name )
7983 self .assertFalse (name in self .service .apps )
8084
81- class TestPackage (TestApp ):
8285 def test_package (self ):
8386 p = self .app .package ()
8487 self .assertEqual (p .name , self .app_name )
8588 self .assertTrue (p .path .endswith (self .app_name + '.spl' ))
8689 self .assertTrue (p .url .endswith (self .app_name + '.spl' ))
8790
88- class TestUpdateInfo (TestApp ):
8991 def test_updateInfo (self ):
9092 p = self .app .updateInfo ()
9193 self .assertTrue (p is not None )
0 commit comments