Files
galaxy/test/unit/objectstore/test_badges.py
T
John Chilton 8792a777ea Refactor badge parsing/serialization/typing for reuse.
There are subtle differences between object stores, user object store instance models, and object store templates in the downstream "bring-your-own-object-store" branch so breaking this stuff out like this should allow for cleaner diffs and reuse.
2023-04-24 10:52:04 -04:00

18 lines
506 B
Python

from galaxy.objectstore.badges import read_badges
def test_read_config_ignores_galaxy_set_badges():
config = {"badges": [{"source": "galaxy", "type": "restricted", "message": "private_storage"}]}
res = read_badges(config)
assert len(res) == 0
def test_exception_on_unknown_badge_type():
config = {"badges": [{"type": "cool_custom", "message": "private_storage"}]}
exc = None
try:
read_badges(config)
except Exception as e:
exc = e
assert exc is not None