From d2559c26b631d7defc880a912e9e6f4a2ff98a77 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Mon, 8 Apr 2019 07:13:34 +0300 Subject: refactoring --- tests/test_app_cleanup.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_app_cleanup.py b/tests/test_app_cleanup.py index 5d5cb743..20f8fdac 100644 --- a/tests/test_app_cleanup.py +++ b/tests/test_app_cleanup.py @@ -21,8 +21,7 @@ import os -import string -import random +import secrets import multiprocessing import multiprocessing.queues import time @@ -36,10 +35,7 @@ from kvmd.apps.cleanup import main def test_main(tmpdir) -> None: # type: ignore queue: multiprocessing.queues.Queue = multiprocessing.Queue() - ustreamer_fake_name = "ustr-" + "".join( - random.choice(string.ascii_lowercase + string.digits) - for _ in range(5) - ) + ustreamer_fake_name = "ustr-" + secrets.token_hex(3) ustreamer_sock_path = os.path.abspath(str(tmpdir.join("ustreamer-fake.sock"))) kvmd_sock_path = os.path.abspath(str(tmpdir.join("kvmd-fake.sock"))) -- cgit v1.2.3