File tree Expand file tree Collapse file tree 7 files changed +141
-11
lines changed Expand file tree Collapse file tree 7 files changed +141
-11
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ release: build
2828 twine upload dist/*
2929
3030@PHONEY : install
31- install : clean
31+ install : clean requirements
3232 python3 -m pip install .
3333
3434@PHONEY : requirements
Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ class Type(Base):
232232 "label" : Property (),
233233 "network_out" : Property (),
234234 "price" : Property (),
235+ "region_prices" : Property (),
235236 "addons" : Property (),
236237 "memory" : Property (),
237238 "transfer" : Property (),
Original file line number Diff line number Diff line change 1+ {
2+ "quota" : 471 ,
3+ "used" : 737373 ,
4+ "billable" : 0 ,
5+
6+ "region_transfers" : [
7+ {
8+ "id" : " ap-west" ,
9+ "used" : 1 ,
10+ "quota" : 5010 ,
11+ "billable" : 0
12+ }
13+ ]
14+ }
Original file line number Diff line number Diff line change 11{
2- "results" : 4 ,
3- "pages" : 1 ,
4- "page" : 1 ,
5- "data" : [
2+ "results" : 4 ,
3+ "pages" : 1 ,
4+ "page" : 1 ,
5+ "data" : [
66 {
77 "disk" : 20480 ,
88 "memory" : 1024 ,
1212 "price" : {
1313 "hourly" : 0.003 ,
1414 "monthly" : 2
15- }
15+ },
16+ "region_prices" : [
17+ {
18+ "id" : " ap-west" ,
19+ "hourly" : 0.02 ,
20+ "monthly" : 20
21+ },
22+ {
23+ "id" : " ap-northeast" ,
24+ "hourly" : 0.02 ,
25+ "monthly" : 20
26+ }
27+ ]
1628 }
1729 },
1830 "class" : " nanode" ,
2537 "hourly" : 0.0075 ,
2638 "monthly" : 5
2739 },
40+ "region_prices" : [
41+ {
42+ "id" : " us-east" ,
43+ "hourly" : 0.02 ,
44+ "monthly" : 20
45+ },
46+ {
47+ "id" : " ap-northeast" ,
48+ "hourly" : 0.02 ,
49+ "monthly" : 20
50+ }
51+ ],
2852 "successor" : null
2953 },
3054 {
3660 "price" : {
3761 "hourly" : 0.008 ,
3862 "monthly" : 5
39- }
63+ },
64+ "region_prices" : [
65+ {
66+ "id" : " ap-west" ,
67+ "hourly" : 0.02 ,
68+ "monthly" : 20
69+ },
70+ {
71+ "id" : " ap-northeast" ,
72+ "hourly" : 0.02 ,
73+ "monthly" : 20
74+ }
75+ ]
4076 }
4177 },
4278 "class" : " highmem" ,
4985 "hourly" : 0.09 ,
5086 "monthly" : 60
5187 },
88+ "region_prices" : [
89+ {
90+ "id" : " us-east" ,
91+ "hourly" : 0.02 ,
92+ "monthly" : 20
93+ },
94+ {
95+ "id" : " ap-northeast" ,
96+ "hourly" : 0.02 ,
97+ "monthly" : 20
98+ }
99+ ],
52100 "successor" : null
53101 },
54102 {
60108 "price" : {
61109 "hourly" : 0.004 ,
62110 "monthly" : 2.5
63- }
111+ },
112+ "region_prices" : [
113+ {
114+ "id" : " ap-west" ,
115+ "hourly" : 0.02 ,
116+ "monthly" : 20
117+ },
118+ {
119+ "id" : " ap-northeast" ,
120+ "hourly" : 0.02 ,
121+ "monthly" : 20
122+ }
123+ ]
64124 }
65125 },
66126 "class" : " standard" ,
73133 "hourly" : 0.015 ,
74134 "monthly" : 10
75135 },
136+ "region_prices" : [
137+ {
138+ "id" : " us-east" ,
139+ "hourly" : 0.02 ,
140+ "monthly" : 20
141+ },
142+ {
143+ "id" : " ap-northeast" ,
144+ "hourly" : 0.02 ,
145+ "monthly" : 20
146+ }
147+ ],
76148 "successor" : null
77149 },
78150 {
84156 "price" : {
85157 "hourly" : 0.008 ,
86158 "monthly" : 5
87- }
159+ },
160+ "region_prices" : [
161+ {
162+ "id" : " ap-west" ,
163+ "hourly" : 0.02 ,
164+ "monthly" : 20
165+ },
166+ {
167+ "id" : " ap-northeast" ,
168+ "hourly" : 0.02 ,
169+ "monthly" : 20
170+ }
171+ ]
88172 }
89173 },
90174 "class" : " gpu" ,
97181 "hourly" : 0.03 ,
98182 "monthly" : 20
99183 },
184+ "region_prices" : [
185+ {
186+ "id" : " us-east" ,
187+ "hourly" : 0.02 ,
188+ "monthly" : 20
189+ },
190+ {
191+ "id" : " ap-northeast" ,
192+ "hourly" : 0.02 ,
193+ "monthly" : 20
194+ }
195+ ],
100196 "successor" : null
101197 }
102198 ]
103- }
199+ }
Original file line number Diff line number Diff line change 33
44import pytest
55
6- from linode_api4 .linode_client import LinodeClient , LongviewSubscription
6+ from linode_api4 .linode_client import LinodeClient
77
88ENV_TOKEN_NAME = "LINODE_TOKEN"
99RUN_LONG_TESTS = "RUN_LONG_TESTS"
Original file line number Diff line number Diff line change @@ -454,6 +454,22 @@ def test_join_beta_program(self):
454454 )
455455 self .assertEqual (m .call_url , join_beta_url )
456456
457+ def test_account_transfer (self ):
458+ """
459+ Tests that payments can be retrieved
460+ """
461+ transfer = self .client .account .transfer ()
462+
463+ self .assertEqual (transfer .quota , 471 )
464+ self .assertEqual (transfer .used , 737373 )
465+ self .assertEqual (transfer .billable , 0 )
466+
467+ self .assertEqual (len (transfer .region_transfers ), 1 )
468+ self .assertEqual (transfer .region_transfers [0 ].id , "ap-west" )
469+ self .assertEqual (transfer .region_transfers [0 ].used , 1 )
470+ self .assertEqual (transfer .region_transfers [0 ].quota , 5010 )
471+ self .assertEqual (transfer .region_transfers [0 ].billable , 0 )
472+
457473
458474class BetaProgramGroupTest (ClientBaseCase ):
459475 """
Original file line number Diff line number Diff line change @@ -533,6 +533,8 @@ def test_get_types(self):
533533 self .assertIsNotNone (t .type_class )
534534 self .assertIsNotNone (t .gpus )
535535 self .assertIsNone (t .successor )
536+ self .assertIsNotNone (t .region_prices )
537+ self .assertIsNotNone (t .addons .backups .region_prices )
536538
537539 def test_get_type_by_id (self ):
538540 """
@@ -546,6 +548,7 @@ def test_get_type_by_id(self):
546548 self .assertEqual (t .label , "Linode 1024" )
547549 self .assertEqual (t .disk , 20480 )
548550 self .assertEqual (t .type_class , "nanode" )
551+ self .assertEqual (t .region_prices [0 ].id , "us-east" )
549552
550553 def test_get_type_gpu (self ):
551554 """
You can’t perform that action at this time.
0 commit comments