diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2020-01-28 14:52:09 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2020-02-26 12:26:29 +0100 |
commit | 59ca679eeb272163e4ebbb2f01231adc4820cda1 (patch) | |
tree | 8c587c3af1dfbdd4ee7c48cbdd3aed8e3c853691 /unittest/helpers.py | |
parent | 0f0225c63b6770c62ca13fcd31fd0e3e83674d93 (diff) | |
download | libnitrokey-59ca679eeb272163e4ebbb2f01231adc4820cda1.tar.gz libnitrokey-59ca679eeb272163e4ebbb2f01231adc4820cda1.tar.bz2 |
Refactor move
Diffstat (limited to 'unittest/helpers.py')
-rw-r--r-- | unittest/helpers.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/unittest/helpers.py b/unittest/helpers.py new file mode 100644 index 0000000..79f4e1e --- /dev/null +++ b/unittest/helpers.py @@ -0,0 +1,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)
\ No newline at end of file |