8
8
import unittest
9
9
10
10
import azure .mgmt .billing
11
- from testutils .common_recordingtestcase import record
12
11
from devtools_testutils import AzureMgmtTestCase
13
12
14
13
class MgmtBillingTest (AzureMgmtTestCase ):
@@ -25,7 +24,7 @@ def _validate_invoice(self, invoice, url_generated=False):
25
24
self .assertIsNotNone (invoice .download_url .expiry_time )
26
25
else :
27
26
self .assertIsNone (invoice .download_url )
28
-
27
+
29
28
def _validate_billing_period (self , billing_period ):
30
29
self .assertIsNotNone (billing_period )
31
30
self .assertIsNotNone (billing_period .id )
@@ -44,41 +43,41 @@ def test_billing_enrollment_accounts_list(self):
44
43
def test_billing_invoice_latest (self ):
45
44
output = self .billing_client .invoices .get_latest ()
46
45
self ._validate_invoice (output , url_generated = True )
47
-
46
+
48
47
def test_billing_invoice_list_get (self ):
49
48
output = list (self .billing_client .invoices .list ())
50
49
self .assertTrue (len (output ) > 0 )
51
50
self ._validate_invoice (output [0 ], url_generated = False )
52
51
invoice = self .billing_client .invoices .get (output [0 ].name )
53
52
self ._validate_invoice (invoice , url_generated = True )
54
-
53
+
55
54
def test_billing_invoice_list_generate_url (self ):
56
55
output = list (self .billing_client .invoices .list (expand = 'downloadUrl' ))
57
56
self .assertTrue (len (output ) > 0 )
58
57
self ._validate_invoice (output [0 ], url_generated = True )
59
-
58
+
60
59
def test_billing_invoice_list_top (self ):
61
60
output = list (self .billing_client .invoices .list (expand = 'downloadUrl' , top = 1 ))
62
61
self .assertEqual (1 , len (output ))
63
62
self ._validate_invoice (output [0 ], url_generated = True )
64
-
63
+
65
64
def test_billing_invoice_list_filter (self ):
66
65
output = list (self .billing_client .invoices .list (filter = 'invoicePeriodEndDate gt 2017-02-01' ))
67
66
self .assertTrue (len (output ) > 0 )
68
67
self ._validate_invoice (output [0 ], url_generated = False )
69
-
68
+
70
69
def test_billing_period_list_get (self ):
71
70
output = list (self .billing_client .billing_periods .list ())
72
71
self .assertTrue (len (output ) > 0 )
73
72
self ._validate_billing_period (output [0 ])
74
73
billing_period = self .billing_client .billing_periods .get (output [0 ].name )
75
74
self ._validate_billing_period (billing_period )
76
-
75
+
77
76
def test_billing_period_list_top (self ):
78
77
output = list (self .billing_client .billing_periods .list (top = 1 ))
79
78
self .assertEqual (1 , len (output ))
80
79
self ._validate_billing_period (output [0 ])
81
-
80
+
82
81
def test_billing_period_list_filter (self ):
83
82
output = list (self .billing_client .billing_periods .list (filter = 'billingPeriodEndDate gt 2017-02-01' ))
84
83
self .assertTrue (len (output ) > 0 )
0 commit comments