Pull out all strings the bot says to a class

Also implement a randomised wrapper
This commit is contained in:
Marc Di Luzio 2024-08-17 21:57:27 +01:00
parent 934c2e24fc
commit 125105469a
6 changed files with 150 additions and 53 deletions

View file

@ -38,3 +38,15 @@ def test_set_nested_dict_value():
}
util.set_nested_value(d, "x", "y", "z", "val", value=52)
assert 52 == util.get_nested_value(d, "x", "y", "z", "val")
def test_randomized():
def string():
return "foo"
def list():
return ["foo", "bar"]
assert util.randomised(string)() == "foo"
assert util.randomised(list)() in list()