コード例 #1
0
ファイル: test_localemock.py プロジェクト: gordonzola/srmlf
def test_exit():
    old_locale = locale.getlocale()
    lm = LocaleMock('POSIX')
    lm.__enter__()
    lm.__exit__()
    assert locale.getlocale() == old_locale
コード例 #2
0
ファイル: test_localemock.py プロジェクト: gordonzola/srmlf
def test_old_locale_with_category():
    old_locale = locale.getlocale(locale.LC_TIME)
    lm = LocaleMock('POSIX', [locale.LC_TIME])
    lm.__enter__()
    lm.__exit__()
    assert locale.getlocale(locale.LC_TIME) == old_locale