File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -348,6 +348,13 @@ def reboot(self):
348348 return False
349349 return True
350350
351+ def resize (self , new_type ):
352+ resp = self ._client .post ("{}/resize" .format (Instance .api_endpoint ), model = self , data = {"type" : new_type })
353+
354+ if 'error' in resp :
355+ return False
356+ return True
357+
351358 @staticmethod
352359 def generate_root_password ():
353360 def _func (value ):
Original file line number Diff line number Diff line change @@ -160,6 +160,18 @@ def test_boot(self):
160160 linode .boot ()
161161 self .assertEqual (m .call_url , '/linode/instances/123/boot' )
162162
163+ def test_resize (self ):
164+ """
165+ Tests that you can submit a correct resize api request
166+ """
167+ linode = Instance (self .client , 123 )
168+ result = {}
169+
170+ with self .mock_post (result ) as m :
171+ linode .resize (new_type = 'g6-standard-1' )
172+ self .assertEqual (m .call_url , '/linode/instances/123/resize' )
173+ self .assertEqual (m .call_data , {'type' : 'g6-standard-1' })
174+
163175 def test_boot_with_config (self ):
164176 """
165177 Tests that you can submit a correct boot with a config api request
You can’t perform that action at this time.
0 commit comments