mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Fix strings tests, now that load_strings needs helpers as an arg
This commit is contained in:
parent
acd8afeb80
commit
22f104cf65
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import locale
|
||||
from onionshare import strings
|
||||
from onionshare import helpers, strings
|
||||
|
||||
|
||||
def test_starts_with_empty_strings():
|
||||
@ -29,12 +29,12 @@ def test_starts_with_empty_strings():
|
||||
def test_load_strings_defaults_to_english():
|
||||
"""load_strings() loads English by default"""
|
||||
locale.getdefaultlocale = lambda: ('en_US', 'UTF-8')
|
||||
strings.load_strings()
|
||||
strings.load_strings(helpers)
|
||||
assert strings._('wait_for_hs') == "Waiting for HS to be ready:"
|
||||
|
||||
|
||||
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")
|
||||
strings.load_strings(helpers, "fr")
|
||||
assert strings._('wait_for_hs') == "En attente du HS:"
|
||||
|
Loading…
Reference in New Issue
Block a user