@@ -21,27 +21,20 @@ def test_list_accounts(self):
2121 'domain' : 'test.example.com' ,
2222 'origin' : '1.1.1.1' ,
2323 'status' : 'CNAME_CONFIGURATION' ,
24- 'unique_id' : '9934111111111 ' ,
24+ 'unique_id' : '11223344 ' ,
2525 'vendor' : 'akamai' }]
2626 )
2727
2828 def test_detail_account (self ):
2929 result = self .run_command (['cdn' , 'detail' , '--history=30' , '1245' ])
3030
3131 self .assert_no_fail (result )
32- self .assertEqual (json .loads (result .output ),
33- {'hit_radio' : '0.0 %' ,
34- 'hostname' : 'test.example.com' ,
35- 'origin' : '1.1.1.1' ,
36- 'origin_type' : 'HOST_SERVER' ,
37- 'path' : '/' ,
38- 'protocol' : 'HTTP' ,
39- 'provider' : 'akamai' ,
40- 'status' : 'CNAME_CONFIGURATION' ,
41- 'total_bandwidth' : '0.0 GB' ,
42- 'total_hits' : '0' ,
43- 'unique_id' : '9934111111111' }
44- )
32+ api_results = json .loads (result .output )
33+ self .assertEqual (api_results ['hit_ratio' ], '2.0 %' )
34+ self .assertEqual (api_results ['total_bandwidth' ], '1.0 GB' )
35+ self .assertEqual (api_results ['total_hits' ], 3 )
36+ self .assertEqual (api_results ['hostname' ], 'test.example.com' )
37+ self .assertEqual (api_results ['protocol' ], 'HTTP' )
4538
4639 def test_purge_content (self ):
4740 result = self .run_command (['cdn' , 'purge' , '1234' ,
@@ -122,7 +115,7 @@ def test_edit_cache(self):
122115 self .assertEqual ('include: test' , header_result ['Cache key optimization' ])
123116
124117 def test_edit_cache_by_uniqueId (self ):
125- result = self .run_command (['cdn' , 'edit' , '9934111111111 ' , '--cache' , 'include-specified' , '--cache' , 'test' ])
118+ result = self .run_command (['cdn' , 'edit' , '11223344 ' , '--cache' , 'include-specified' , '--cache' , 'test' ])
126119 self .assert_no_fail (result )
127120 header_result = json .loads (result .output )
128121 self .assertEqual ('include: test' , header_result ['Cache key optimization' ])
0 commit comments