def test_get_type_gpu(self): """ Tests that gpu types load up right """ t = Type(self.client, "g5-gpu-2") self.assertEqual(t._populated, False) self.assertEqual(t.gpus, 1) self.assertEqual(t._populated, True)
def test_get_type_by_id(self): """ Tests that a Linode type is loaded correctly by ID """ t = Type(self.client, 'g5-nanode-1') self.assertEqual(t._populated, False) self.assertEqual(t.vcpus, 1) self.assertEqual(t.label, "Linode 1024") self.assertEqual(t.disk, 20480)
def test_resize_with_class(self): """ Tests that you can submit a correct resize api request with a Base class type """ linode = Instance(self.client, 123) ltype = Type(self.client, 'g6-standard-2') result = {} with self.mock_post(result) as m: linode.resize(new_type=ltype) self.assertEqual(m.call_url, '/linode/instances/123/resize') self.assertEqual(m.call_data, {'type': 'g6-standard-2'})