mirror of
https://github.com/onionshare/onionshare.git
synced 2025-07-26 16:15:51 -04:00
split tests into multiple files, and fixed tests to work with refactor
This commit is contained in:
parent
54a37ee28e
commit
a32ca2f7a9
5 changed files with 103 additions and 83 deletions
17
test/onionshare_web_test.py
Normal file
17
test/onionshare_web_test.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from onionshare import web
|
||||
from nose import with_setup
|
||||
|
||||
def test_generate_slug_length():
|
||||
"generates a 26-character slug"
|
||||
assert len(web.slug) == 26
|
||||
|
||||
def test_generate_slug_characters():
|
||||
"generates a base32-encoded slug"
|
||||
|
||||
def is_b32(string):
|
||||
b32_alphabet = "01234556789abcdefghijklmnopqrstuvwxyz"
|
||||
return all(char in b32_alphabet for char in string)
|
||||
|
||||
assert is_b32(web.slug)
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue