File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -177,23 +177,22 @@ def test_show_ophyd_symbols(self):
177177class Test_With_Database (unittest .TestCase ):
178178
179179 def setUp (self ):
180- pass
180+ from tests .test_export_json import get_db
181+ self .db = get_db ()
181182
182183 def tearDown (self ):
183184 pass
184185
185186 def test_list_recent_scans (self ):
186- from tests .test_export_json import get_db
187- db = get_db ()
188- headers = db (plan_name = "count" )
187+ headers = self .db (plan_name = "count" )
189188 headers = list (headers )[0 :1 ]
190189 self .assertEqual (len (headers ), 1 )
191190 table = APS_utils .list_recent_scans (
192191 keys = ["exit_status" ,],
193192 show_command = True ,
194193 printing = False ,
195194 num = 10 ,
196- db = db ,
195+ db = self . db ,
197196 )
198197 self .assertIsNotNone (table )
199198 self .assertEqual (
@@ -209,6 +208,18 @@ def test_list_recent_scans(self):
209208 40 ,
210209 "command row should be 40 char or less" )
211210
211+ def test_replay (self ):
212+ replies = []
213+ def my_cb (key , doc ):
214+ replies .append ((key , len (doc )))
215+ APS_utils .replay (self .db (plan_name = "count" ), callback = my_cb )
216+
217+ self .assertGreater (len (replies ), 0 )
218+ keys = set ([v [0 ] for v in replies ])
219+ for item in "start stop event descriptor datum resource" .split ():
220+ msg = f"{ item } not in { keys } "
221+ self .assertIn (item , keys , msg )
222+
212223
213224def suite (* args , ** kw ):
214225 test_list = [
You can’t perform that action at this time.
0 commit comments