Fix /leave not working for anyone who's paused in the past
Some checks failed
Test, Build and Publish / test (push) Has been cancelled
Test, Build and Publish / build-and-push-images (push) Has been cancelled

We now clear the re-activate value when a user is unpaused.

Added bonus here is various bits of refactor and cleanup, with some tests
This commit is contained in:
Marc Di Luzio 2024-08-17 14:14:45 +01:00
parent 946de66f52
commit f926a36069
5 changed files with 91 additions and 37 deletions

View file

@ -10,3 +10,31 @@ def test_iterate_all_shifts():
[3, 4, 1, 2],
[4, 1, 2, 3],
]
def test_get_nested_dict_value():
d = {
"x": {
"y": {
"z": {
"val": 42
}
}
}
}
assert 42 == util.get_nested_value(d, "x", "y", "z", "val")
assert 16 == util.get_nested_value(d, "x", "y", "z", "vol", default=16)
def test_set_nested_dict_value():
d = {
"x": {
"y": {
"z": {
"val": 42
}
}
}
}
util.set_nested_value(d, "x", "y", "z", "val", value=52)
assert 52 == util.get_nested_value(d, "x", "y", "z", "val")