Skip to content

Commit

Permalink
TST: Exercise codepath with numpy.product call
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Jun 20, 2024
1 parent 43a742e commit 41537cc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions databroker/tests/test_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,3 +1289,22 @@ def test_update(db, RE, hw):
with pytest.raises(ValueError):
c[uid].update_metadata({"start": {"uid": "not allowed to change this"}})


def test_img_read(db, RE, hw):
"Test reading 2D data referenced by Datum, Resource."
RE.subscribe(db.insert)
if not hasattr(db, "v2"):
raise pytest.skip("v0 has no v2 accessor")
c = db.v2
uid, = get_uids(RE(count([hw.img], 5)))
c[uid]["primary"]["data"]["img"][:]


def test_direct_img_read(db, RE, hw):
"Test reading 2D data placed directly in the Event document."
RE.subscribe(db.insert)
if not hasattr(db, "v2"):
raise pytest.skip("v0 has no v2 accessor")
c = db.v2
uid, = get_uids(RE(count([hw.direct_img], 5)))
c[uid]["primary"]["data"]["img"][:]

0 comments on commit 41537cc

Please sign in to comment.