|
1 | 1 | from datetime import datetime |
2 | 2 | from test.base import ClientBaseCase |
3 | 3 |
|
4 | | -from linode_api4.objects import Config, Disk, Image, Instance, Type |
| 4 | +from linode_api4.objects import Config, Disk, Image, Instance, StackScript, Type |
5 | 5 |
|
6 | 6 |
|
7 | 7 | class LinodeTest(ClientBaseCase): |
@@ -452,6 +452,27 @@ def test_get_config(self): |
452 | 452 | self.assertIsNotNone(config.devices) |
453 | 453 |
|
454 | 454 |
|
| 455 | +class StackScriptTest(ClientBaseCase): |
| 456 | + """ |
| 457 | + Tests the methods of the StackScript class. |
| 458 | + """ |
| 459 | + |
| 460 | + def test_get_stackscript(self): |
| 461 | + """ |
| 462 | + Tests that a stackscript is loaded correctly by ID |
| 463 | + """ |
| 464 | + stackscript = StackScript(self.client, 10079) |
| 465 | + |
| 466 | + self.assertEqual(stackscript.id, 10079) |
| 467 | + self.assertEqual(stackscript.deployments_active, 1) |
| 468 | + self.assertEqual(stackscript.deployments_total, 12) |
| 469 | + self.assertEqual(stackscript.rev_note, "Set up MySQL") |
| 470 | + self.assertTrue(stackscript.mine) |
| 471 | + self.assertTrue(stackscript.is_public) |
| 472 | + self.assertIsNotNone(stackscript.user_defined_fields) |
| 473 | + self.assertIsNotNone(stackscript.images) |
| 474 | + |
| 475 | + |
455 | 476 | class TypeTest(ClientBaseCase): |
456 | 477 | def test_get_types(self): |
457 | 478 | """ |
|
0 commit comments