33from datetime import datetime
44from test .unit .base import ClientBaseCase
55
6+ from linode_api4 import AccountSettingsInterfacesForNewLinodes
67from linode_api4 .objects import (
78 Account ,
89 AccountAvailability ,
@@ -97,6 +98,7 @@ def test_get_account(self):
9798 self .assertEqual (account .balance_uninvoiced , 145 )
9899 self .assertEqual (account .billing_source , "akamai" )
99100 self .assertEqual (account .euuid , "E1AF5EEC-526F-487D-B317EBEB34C87D71" )
101+ self .assertIn ("Linode Interfaces" , account .capabilities )
100102
101103 def test_get_login (self ):
102104 """
@@ -121,6 +123,31 @@ def test_get_account_settings(self):
121123 self .assertEqual (settings .network_helper , False )
122124 self .assertEqual (settings .object_storage , "active" )
123125 self .assertEqual (settings .backups_enabled , True )
126+ self .assertEqual (
127+ settings .interfaces_for_new_linodes ,
128+ AccountSettingsInterfacesForNewLinodes .linode_default_but_legacy_config_allowed ,
129+ )
130+
131+ def test_post_account_settings (self ):
132+ """
133+ Tests that account settings can be updated successfully
134+ """
135+ settings = self .client .account .settings ()
136+
137+ settings .network_helper = True
138+ settings .backups_enabled = False
139+ settings .interfaces_for_new_linodes = (
140+ AccountSettingsInterfacesForNewLinodes .linode_only
141+ )
142+
143+ with self .mock_put ("/account/settings" ) as m :
144+ settings .save ()
145+
146+ assert m .call_data == {
147+ "network_helper" : True ,
148+ "backups_enabled" : False ,
149+ "interfaces_for_new_linodes" : AccountSettingsInterfacesForNewLinodes .linode_only ,
150+ }
124151
125152 def test_get_event (self ):
126153 """
0 commit comments