aboutsummaryrefslogtreecommitdiff
path: root/tests/test_alphanum.py
blob: d567bdb99902dc919f7ce0ae02874d979f4e2020 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import alphanum


def test_no_string_length():
    foo = alphanum.generate()
    assert len(foo) == 1


def test_with_string_length():
    foo = alphanum.generate(10)
    assert len(foo) == 10


def test_subsequent_strings_differ():
    foo = alphanum.generate(10)
    bar = alphanum.generate(10)
    assert foo != bar


def test_secure_no_string_length():
    foo = alphanum.generate_s()
    assert len(foo) == 1


def test_secure_with_string_length():
    foo = alphanum.generate_s(10)
    assert len(foo) == 10


def test_secure_subsequent_strings_differ():
    foo = alphanum.generate_s(10)
    bar = alphanum.generate_s(10)
    assert foo != bar