Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/bioblend/_tests/TestCloudmanServices.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 """ | |
2 Tests the functionality of the Blend CloudMan API. These tests require working | |
3 credentials to supported cloud infrastructure. | |
4 """ | |
5 from bioblend.cloudman import CloudManConfig, CloudManInstance | |
6 from . import CloudmanTestBase, test_util | |
7 | |
8 | |
9 @test_util.skip_unless_cloudman() | |
10 class TestCloudmanServices(CloudmanTestBase.CloudmanTestBase): | |
11 | |
12 @classmethod | |
13 def setUpClass(cls): | |
14 super().setUpClass() | |
15 cls.cfg = CloudManConfig(cls.access_key, cls.secret_key, cls.cluster_name, cls.ami_id, cls.instance_type, cls.password, cloud_metadata=cls.cloud_metadata) | |
16 cls.cmi = CloudManInstance.launch_instance(cls.cfg) | |
17 | |
18 def setUp(self): | |
19 self.cmi = self.__class__.cmi | |
20 | |
21 def test_get_status(self): | |
22 status = self.cmi.get_status() | |
23 self.assertIsNotNone(status) | |
24 | |
25 def test_get_nodes(self): | |
26 nodes = self.cmi.get_nodes() | |
27 self.assertIsNotNone(nodes) | |
28 | |
29 def test_add_nodes(self): | |
30 num_nodes = 1 | |
31 status = self.cmi.add_nodes(num_nodes) | |
32 self.assertIsNotNone(status) | |
33 | |
34 def test_reboot_node(self): | |
35 instance_id = self.cmi.instance_id | |
36 self.cmi.reboot_node(instance_id) | |
37 | |
38 def test_remove_node(self): | |
39 instance_id = self.cmi.instance_id | |
40 self.cmi.remove_node(instance_id, force=True) | |
41 | |
42 def test_enable_autoscaling(self): | |
43 self.assertFalse(self.cmi.autoscaling_enabled()) | |
44 self.cmi.enable_autoscaling(minimum_nodes=0, maximum_nodes=19) | |
45 self.assertTrue(self.cmi.autoscaling_enabled()) | |
46 | |
47 def test_disable_autoscaling(self): | |
48 self.cmi.disable_autoscaling() | |
49 self.assertFalse(self.cmi.autoscaling_enabled()) | |
50 | |
51 def test_adjust_autoscaling(self): | |
52 self.cmi.adjust_autoscaling(minimum_nodes=3, maximum_nodes=4) | |
53 | |
54 # def test_get_galaxy_state_stopped(self): | |
55 # self.assertEqual(self.cmi.get_galaxy_state(), "'Galaxy' is not running") |