Move icons to resource folder, fix the unicode issue, support zh-tw lang
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
from libs.lib import struct, newAction, newIcon, addActions, fmtShortcut, generateColorByText
|
||||
|
||||
class TestLib(unittest.TestCase):
|
||||
|
||||
def test_generateColorByGivingUniceText_noError(self):
|
||||
res = generateColorByText(u'\u958B\u555F\u76EE\u9304')
|
||||
self.assertTrue(res.green() >= 0)
|
||||
self.assertTrue(res.red() >= 0)
|
||||
self.assertTrue(res.blue() >= 0)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
from stringBundle import StringBundle
|
||||
|
||||
class TestStringBundle(unittest.TestCase):
|
||||
|
||||
def test_loadDefaultBundle_withoutError(self):
|
||||
strBundle = StringBundle.getBundle('en')
|
||||
self.assertEqual(strBundle.getString("openDir"), 'Open Dir', 'Fail to load the default bundle')
|
||||
|
||||
def test_fallback_withoutError(self):
|
||||
strBundle = StringBundle.getBundle('zh-TW')
|
||||
self.assertEqual(strBundle.getString("openDir"), u'\u958B\u555F\u76EE\u9304', 'Fail to load the zh-TW bundle')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user