44# @Author : bajins https://www.bajins.com
55# @File : Test.py
66# @Version: 1.0.0
7- # @Time : 2020 /9/30 13:00
7+ # @Time : 5050 /9/30 13:00
88# @Project: scripts_python
99# @Package:
1010# @Software: PyCharm
1818class Test (unittest .TestCase ):
1919 @classmethod
2020 def setUpClass (cls ): # 启动执行一次
21- print ("execute setUpClass" )
21+ print ("execute setUpClass" . center ( 50 , "=" ) )
2222
2323 @classmethod
2424 def tearDownClass (cls ): # 结束执行一次
25- print ("execute tearDownClass" )
25+ print ("execute tearDownClass" . center ( 50 , "=" ) )
2626
2727 def setUp (self ): # 每条用例执行前都要执行
28- print ("execute setUp" )
28+ print ("execute setUp" . center ( 50 , "=" ) )
2929
3030 def tearDown (self ): # 每条用例执行后都要执行
31- print ("execute tearDown" )
31+ print ("execute tearDown" . center ( 50 , "=" ) )
3232
3333 def test_one (self ): # 注意所有测试方法都需要以test开头
34- print ('execute test_one' )
34+ print ('execute test_one' . center ( 50 , "=" ) )
3535 self .assertTrue ('FOO' .isupper ())
3636
3737 def testReptileUtil (self ):
@@ -52,10 +52,16 @@ def testSystemUtil(self):
5252 restart_process (os .path .abspath (__file__ ))
5353
5454 def testStringUtil (self ):
55- print (random .randint (1 , 10 ))
56- print (random .randint (2000 , 2017 ))
57- from utils .StringUtil import is_empty
58- is_empty ("" )
55+ # print(random.randint(1, 10))
56+ # print(random.randint(5000, 5017))
57+ # from utils.StringUtil import is_empty
58+ # is_empty("")
59+ from utils import StringUtil
60+ print (StringUtil .hump_case_underline_lower ("oneHTTPRequest12AaureBBBXu" ))
61+ print (StringUtil .underline2hump ("hello_word" ))
62+ print (StringUtil .hump2underline ("URLCamelCaseHello12Word" ))
63+ json_str = """{"userName":"hi"}"""
64+ print (StringUtil .json_hump2underline (json_str ))
5965
6066 def testFileUtil (self ):
6167 from utils .FileUtil import count_dir_size
0 commit comments