mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-27 16:29:41 -05:00
18 lines
411 B
Python
18 lines
411 B
Python
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)
|
|
|
|
|