Skip to content

Commit 4efaab8

Browse files
author
Fabien Coelho
committed
simpler code
1 parent 1ec3895 commit 4efaab8

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

tests/secret.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
import random
55
import string
66

7-
# parameters
8-
LENGTH = 16
9-
CHARS = string.printable.replace(",", "") # all but ","
10-
USERS = ["calvin", "hobbes", "susie", "moe"]
11-
12-
# login -> clear-password
13-
PASSES: dict[str, str] = {}
14-
157
# both client and server must share the same seed!
168
random.seed(os.environ.get("TEST_SEED", None))
179

18-
# generate 4 users with pseudo-random 16-chars passwords
19-
for login in USERS:
20-
PASSES[login] = "".join(random.choice(CHARS) for _ in range(LENGTH))
10+
# parameters
11+
LENGTH: int = 16
12+
CHARS: str = string.printable.replace(",", "") # all but ","
13+
USERS: list[str] = ["calvin", "hobbes", "susie", "moe"]
14+
15+
# login -> clear-password
16+
PASSES: dict[str, str] = {
17+
login: "".join(random.choice(CHARS) for _ in range(LENGTH))
18+
for login in USERS
19+
}

0 commit comments

Comments
 (0)