Add hebrew and chinese
This commit is contained in:
0
tests/test_locale/פטכש/__init__.py
Normal file
0
tests/test_locale/פטכש/__init__.py
Normal file
30
tests/test_locale/פטכש/test_codec.py
Normal file
30
tests/test_locale/פטכש/test_codec.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# Hebrew
|
||||
|
||||
import os
|
||||
import platform
|
||||
from tests.test_locale.locale_functions import GetPath
|
||||
|
||||
|
||||
def test_codec():
|
||||
use_codec = {
|
||||
"Windows": "cp1252",
|
||||
"Linux" : "utf8",
|
||||
"Darwin" : "utf8",
|
||||
}
|
||||
|
||||
os_name = platform.system()
|
||||
current_directory = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
try:
|
||||
decoded_file = GetPath(current_directory, "testcodec", use_codec[os_name])
|
||||
except:
|
||||
assert False, "Specified codec (" + use_codec[os_name] + ") failed to decrypt file path."
|
||||
|
||||
try:
|
||||
with open(decoded_file, 'r') as f:
|
||||
read_data = f.read()
|
||||
f.closed
|
||||
except:
|
||||
assert False, "Specified codec (" + use_codec[os_name] + ") failed to read file."
|
||||
|
||||
assert read_data == "True"
|
||||
1
tests/test_locale/פטכש/testcodec
Normal file
1
tests/test_locale/פטכש/testcodec
Normal file
@@ -0,0 +1 @@
|
||||
True
|
||||
0
tests/test_locale/测试/__init__.py
Normal file
0
tests/test_locale/测试/__init__.py
Normal file
30
tests/test_locale/测试/test_codec.py
Normal file
30
tests/test_locale/测试/test_codec.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# Chinese (Simplified)
|
||||
|
||||
import os
|
||||
import platform
|
||||
from tests.test_locale.locale_functions import GetPath
|
||||
|
||||
|
||||
def test_codec():
|
||||
use_codec = {
|
||||
"Windows": "cp1252",
|
||||
"Linux" : "utf8",
|
||||
"Darwin" : "utf8",
|
||||
}
|
||||
|
||||
os_name = platform.system()
|
||||
current_directory = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
try:
|
||||
decoded_file = GetPath(current_directory, "testcodec", use_codec[os_name])
|
||||
except:
|
||||
assert False, "Specified codec (" + use_codec[os_name] + ") failed to decrypt file path."
|
||||
|
||||
try:
|
||||
with open(decoded_file, 'r') as f:
|
||||
read_data = f.read()
|
||||
f.closed
|
||||
except:
|
||||
assert False, "Specified codec (" + use_codec[os_name] + ") failed to read file."
|
||||
|
||||
assert read_data == "True"
|
||||
1
tests/test_locale/测试/testcodec
Normal file
1
tests/test_locale/测试/testcodec
Normal file
@@ -0,0 +1 @@
|
||||
True
|
||||
Reference in New Issue
Block a user