4
4
# @Author : bajins https://www.bajins.com
5
5
# @File : Test.py
6
6
# @Version: 1.0.0
7
- # @Time : 2020 /9/30 13:00
7
+ # @Time : 5050 /9/30 13:00
8
8
# @Project: scripts_python
9
9
# @Package:
10
10
# @Software: PyCharm
18
18
class Test (unittest .TestCase ):
19
19
@classmethod
20
20
def setUpClass (cls ): # 启动执行一次
21
- print ("execute setUpClass" )
21
+ print ("execute setUpClass" . center ( 50 , "=" ) )
22
22
23
23
@classmethod
24
24
def tearDownClass (cls ): # 结束执行一次
25
- print ("execute tearDownClass" )
25
+ print ("execute tearDownClass" . center ( 50 , "=" ) )
26
26
27
27
def setUp (self ): # 每条用例执行前都要执行
28
- print ("execute setUp" )
28
+ print ("execute setUp" . center ( 50 , "=" ) )
29
29
30
30
def tearDown (self ): # 每条用例执行后都要执行
31
- print ("execute tearDown" )
31
+ print ("execute tearDown" . center ( 50 , "=" ) )
32
32
33
33
def test_one (self ): # 注意所有测试方法都需要以test开头
34
- print ('execute test_one' )
34
+ print ('execute test_one' . center ( 50 , "=" ) )
35
35
self .assertTrue ('FOO' .isupper ())
36
36
37
37
def testReptileUtil (self ):
@@ -52,10 +52,16 @@ def testSystemUtil(self):
52
52
restart_process (os .path .abspath (__file__ ))
53
53
54
54
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 ))
59
65
60
66
def testFileUtil (self ):
61
67
from utils .FileUtil import count_dir_size
0 commit comments