X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Fintegration%2Ftestlib%2Fcheck.py;h=3b7dec170286fbebd79d35d46281cf176be6df8d;hb=1287fc13ccdf96cd18a391d53ce9b47c29b198e2;hp=a82e0e439bcaf9473322f5d80b0b65d79e6fc7b4;hpb=7bc1936eded0367aab1a4b9a393ccfd74ab110f7;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: