@@ -659,19 +659,19 @@ def test_dns_sync_both(self, confirm_mock):
659659 'getResourceRecords' )
660660 getResourceRecords .return_value = []
661661 createAargs = ({
662- 'type' : 'a' ,
663- 'host' : 'hardware-test1' ,
664- 'domainId' : 12345 , # from SoftLayer_Account::getDomains
665- 'data' : '172.16.1.100' ,
666- 'ttl' : 7200
667- },)
662+ 'type' : 'a' ,
663+ 'host' : 'hardware-test1' ,
664+ 'domainId' : 12345 , # from SoftLayer_Account::getDomains
665+ 'data' : '172.16.1.100' ,
666+ 'ttl' : 7200
667+ },)
668668 createPTRargs = ({
669- 'type' : 'ptr' ,
670- 'host' : '100' ,
671- 'domainId' : 123456 ,
672- 'data' : 'hardware-test1.test.sftlyr.ws' ,
673- 'ttl' : 7200
674- },)
669+ 'type' : 'ptr' ,
670+ 'host' : '100' ,
671+ 'domainId' : 123456 ,
672+ 'data' : 'hardware-test1.test.sftlyr.ws' ,
673+ 'ttl' : 7200
674+ },)
675675
676676 result = self .run_command (['hw' , 'dns-sync' , '1000' ])
677677
@@ -714,12 +714,12 @@ def test_dns_sync_v6(self, confirm_mock):
714714 }
715715 }
716716 createV6args = ({
717- 'type' : 'aaaa' ,
718- 'host' : 'hardware-test1' ,
719- 'domainId' : 12345 , # from SoftLayer_Account::getDomains
720- 'data' : '2607:f0d0:1b01:0023:0000:0000:0000:0004' ,
721- 'ttl' : 7200
722- },)
717+ 'type' : 'aaaa' ,
718+ 'host' : 'hardware-test1' ,
719+ 'domainId' : 12345 , # from SoftLayer_Account::getDomains
720+ 'data' : '2607:f0d0:1b01:0023:0000:0000:0000:0004' ,
721+ 'ttl' : 7200
722+ },)
723723 server .return_value = test_server
724724 result = self .run_command (['hw' , 'dns-sync' , '--aaaa-record' , '1000' ])
725725 self .assert_no_fail (result )
@@ -826,3 +826,19 @@ def test_dns_sync_misc_exception(self, confirm_mock):
826826 result = self .run_command (['hw' , 'dns-sync' , '-a' , '1000' ])
827827 self .assertEqual (result .exit_code , 2 )
828828 self .assertIsInstance (result .exception , exceptions .CLIAbort )
829+
830+ def test_billing (self ):
831+ result = self .run_command (['hw' , 'billing' , '123456' ])
832+ billing_json = {
833+ 'Billing Item Id' : 6327 ,
834+ 'Id' : '123456' ,
835+ 'Provision Date' : None ,
836+ 'Recurring Fee' : 1.54 ,
837+ 'Total' : 16.08 ,
838+ 'prices' : [{
839+ 'Item' : 'test' ,
840+ 'Recurring Price' : 1
841+ }]
842+ }
843+ self .assert_no_fail (result )
844+ self .assertEqual (json .loads (result .output ), billing_json )
0 commit comments