X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Fintegration%2Ftestlib%2Fcheck.py;h=3b7dec170286fbebd79d35d46281cf176be6df8d;hb=fa87753574693e3d71dd035983cbdfb136fdb0d8;hp=a82e0e439bcaf9473322f5d80b0b65d79e6fc7b4;hpb=2f2bda4d1953617b945f1222e008cb53edee162a;p=tinc diff --git a/test/integration/testlib/check.py b/test/integration/testlib/check.py index a82e0e43..3b7dec17 100755 --- a/test/integration/testlib/check.py +++ b/test/integration/testlib/check.py @@ -10,6 +10,12 @@ Val = T.TypeVar("Val") Num = T.TypeVar("Num", int, float) +def blank(value: T.AnyStr) -> None: + """Check that value is an empty or blank string.""" + if not isinstance(value, str) or value.strip(): + raise ValueError(f'expected "{value!r}" to be a blank string') + + def false(value: T.Any) -> None: """Check that value is falsy.""" if value: