tests/unix/mod_os: Make os.system() test work on windows.

The "true" command by default is unavailable on windows so use
an equivalent which works on both unix and windows.

Signed-off-by: stijn <stijn@ignitron.net>
This commit is contained in:
stijn 2023-08-23 15:57:23 +02:00 committed by Damien George
parent f4a6fc2c8e
commit 83f2f36b9e

View File

@ -12,7 +12,7 @@ os.unsetenv("TEST_VARIABLE")
print(os.getenv("TEST_VARIABLE")) print(os.getenv("TEST_VARIABLE"))
print(os.getenv("TEST_VARIABLE", "TEST_DEFAULT_VALUE")) print(os.getenv("TEST_VARIABLE", "TEST_DEFAULT_VALUE"))
print(os.system("true")) print(os.system("exit 0"))
rand = os.urandom(4) rand = os.urandom(4)
print(type(rand) is bytes, len(rand)) print(type(rand) is bytes, len(rand))