@@ -37,17 +37,11 @@ def setUp(self):
3737
3838 def tearDown (self ):
3939 # kill SigTest waveforms
40- url = '/domains/' + Default .DOMAIN_NAME
41- json , resp = self ._json_request (url , 200 )
42- if 'applications' not in json :
43- json ['applications' ] = []
44- for a in json ['applications' ]:
45- if a ['name' ].startswith ('SigTest' ):
46- self ._json_request (
47- '/domains/' + Default .DOMAIN_NAME + '/applications/' + a ['id' ],
48- 200 ,
49- 'DELETE'
50- )
40+ dom = self .redhawk ._get_domain (Default .DOMAIN_NAME )
41+ apps = dom .find_app ()
42+ for app in apps :
43+ if app .name .startswith (Default .WAVEFORM ):
44+ app .releaseObject ()
5145 super (ApplicationTests , self ).tearDown ();
5246
5347 @tornado .gen .coroutine
@@ -125,11 +119,12 @@ def test_info(self):
125119 self .assertAttr (json , 'id' , wf_id )
126120
127121 self .assertList (json , 'properties' )
128- # TODO: self.assertProperties(json['properties'])
122+ self .assertProperties (json ['properties' ])
129123
130124 @tornado .testing .gen_test
131125 def test_detect_new_applications (self ):
132- yield [ self .detect_new_applications () for x in xrange (10 ) ]
126+ # yield [ self.detect_new_applications() for x in xrange(10) ]
127+ yield self .detect_new_applications ()
133128
134129 @tornado .gen .coroutine
135130 def detect_new_applications (self ):
@@ -138,31 +133,29 @@ def detect_new_applications(self):
138133
139134 # start a new app
140135 id = yield self .redhawk .launch_application (Default .DOMAIN_NAME , Default .WAVEFORM )
141-
142- # yield self._async_sleep(.5)
143-
136+ self ._async_sleep (1 )
137+
144138 # ensure it exists in the application
145139 url , apps2 = yield self ._get_applications ()
146140 if id not in (a ['id' ] for a in apps2 ):
147141 self .fail ("Expecting %s in domain %s" % (id , Default .DOMAIN_NAME ))
148- # if (len(apps)+1 != len(apps2)):
149- # self.fail("Expecting one additional app %s %s" % (apps, apps2))
142+ if (len (apps )+ 1 != len (apps2 )):
143+ self .fail ("Expecting one additional app %s %s" % (apps , apps2 ))
150144
151145 # now release it
152146 yield self .redhawk .release_application (Default .DOMAIN_NAME , id )
147+ self ._async_sleep (1 )
153148
154149 # ensure it is missing in the application list
155150 url , apps3 = yield self ._get_applications ()
156151 if id in (a ['id' ] for a in apps3 ):
157152 self .fail ("Not Expecting %s in domain %s" % (id , Default .DOMAIN_NAME ))
158- # if (len(apps) != len(apps3)):
159- # self.fail("Expecting same number of apps %s %s" % (apps, apps3))
153+ if (len (apps ) != len (apps3 )):
154+ self .fail ("Expecting same number of apps %s %s" % (apps , apps3 ))
160155
161156
162157 @tornado .testing .gen_test
163158 def test_not_found (self ):
164159 url = '/domains/%s/applications/adskfhsdhfasdhjfhsd' % Default .DOMAIN_NAME
165160 json , resp = yield self ._async_json_request (url , 404 )
166-
167- self ._resource_not_found (json )
168161
0 commit comments