mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-03 15:05:11 -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
21
test/onionshare_strings_test.py
Normal file
21
test/onionshare_strings_test.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
import locale
|
||||
from onionshare import strings
|
||||
from nose import with_setup
|
||||
|
||||
def test_starts_with_empty_strings():
|
||||
"creates an empty strings dict by default"
|
||||
assert strings.strings == {}
|
||||
|
||||
def test_load_strings_defaults_to_english():
|
||||
"load_strings() loads English by default"
|
||||
locale.getdefaultlocale = lambda: ('en_US', 'UTF-8')
|
||||
strings.load_strings()
|
||||
assert strings._('calculating_sha1') == "Calculating SHA1 checksum."
|
||||
|
||||
def test_load_strings_loads_other_languages():
|
||||
"load_strings() loads other languages in different locales"
|
||||
locale.getdefaultlocale = lambda: ('fr_FR', 'UTF-8')
|
||||
strings.load_strings("fr")
|
||||
assert strings._('calculating_sha1') == "Calculer un hachage SHA-1."
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue