aboutsummaryrefslogtreecommitdiff
path: root/unittest/helpers.py
blob: 79f4e1ebcf28e3002af521b1ceb85df4e1cd0300 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
def bb(x):
    return bytes(x, encoding='ascii')


def helper_fill(str_to_fill, target_width):
    assert target_width >= len(str_to_fill)
    numbers = '1234567890' * 4
    str_to_fill += numbers[:target_width - len(str_to_fill)]
    assert len(str_to_fill) == target_width
    return bb(str_to_fill)


def helper_PWS_get_pass(suffix):
    return helper_fill('pass' + suffix, 20)


def helper_PWS_get_loginname(suffix):
    return helper_fill('login' + suffix, 32)


def helper_PWS_get_slotname(suffix):
    return helper_fill('slotname' + suffix, 11)