Fix strings tests, now that load_strings needs helpers as an arg

This commit is contained in:
Micah Lee 2016-09-04 20:02:20 -07:00
parent acd8afeb80
commit 22f104cf65
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -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:"