Files
notifications-admin/tests/notifications_utils/test_take.py
Carlo Costino 57e9fc9ba1 Localize notification_utils to the Admin!
This changeset copies everything in notifications_utils to turn into a local project module.  It includes dependency changes to account for this adjustment and the notifications_utils tests.  It also fixes all of the import statements.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2024-04-05 12:51:31 -04:00

20 lines
456 B
Python

from notifications_utils.take import Take
def _uppercase(value):
return value.upper()
def _append(value, to_append):
return value + to_append
def _prepend_with_service_name(value, service_name=None):
return "{}: {}".format(service_name, value)
def test_take():
assert "Service name: HELLO WORLD!" == Take("hello world").then(_uppercase).then(
_append, "!"
).then(_prepend_with_service_name, service_name="Service name")