diff options
Diffstat (limited to 'troveclient/tests')
-rw-r--r-- | troveclient/tests/fakes.py | 14 | ||||
-rw-r--r-- | troveclient/tests/osc/v1/test_database_configurations.py | 18 | ||||
-rw-r--r-- | troveclient/tests/osc/v1/test_database_instances.py | 14 | ||||
-rw-r--r-- | troveclient/tests/osc/v1/test_datastores.py | 8 |
4 files changed, 37 insertions, 17 deletions
diff --git a/troveclient/tests/fakes.py b/troveclient/tests/fakes.py index c692cc9..7328edf 100644 --- a/troveclient/tests/fakes.py +++ b/troveclient/tests/fakes.py @@ -173,7 +173,10 @@ class FakeHTTPClient(base_client.HTTPClient): "volume": {"size": 2}, "flavor": {"id": "02"}, "region": "regionOne", - "datastore": {"version": "5.6", "type": "mysql"}, + "datastore": { + "version": "5.6", "type": "mysql", + "version_number": "5.7.29" + }, "tenant_id": "fake_tenant_id", "replica_of": {"id": "fake_master_id"}, "access": {"is_public": False, "allowed_cidrs": []} @@ -188,7 +191,10 @@ class FakeHTTPClient(base_client.HTTPClient): "volume": {"size": 2}, "flavor": {"id": "2"}, "region": "regionOne", - "datastore": {"version": "5.6", "type": "mysql"}, + "datastore": { + "version": "5.6", "type": "mysql", + "version_number": "5.7.29" + }, "tenant_id": "fake_tenant_id", "access": {"is_public": False, "allowed_cidrs": []} }, @@ -231,7 +237,8 @@ class FakeHTTPClient(base_client.HTTPClient): }, "datastore": { "version": "5.6", - "type": "mysql" + "type": "mysql", + "version_number": "5.7.29" }}}) def post_instances(self, body, **kw): @@ -503,6 +510,7 @@ class FakeHTTPClient(base_client.HTTPClient): "name": "test_config", "created": "2015-05-16T10:24:28", "datastore_version_name": "5.6", + "datastore_version_number": "5.7.29", "id": "c-123", "values": {"max_connections": 5}, "datastore_version_id": "d-123", "description": ''}]}) diff --git a/troveclient/tests/osc/v1/test_database_configurations.py b/troveclient/tests/osc/v1/test_database_configurations.py index dbd2dc6..f97302c 100644 --- a/troveclient/tests/osc/v1/test_database_configurations.py +++ b/troveclient/tests/osc/v1/test_database_configurations.py @@ -41,7 +41,7 @@ class TestConfigurationList(TestConfigurations): } columns = database_configurations.ListDatabaseConfigurations.columns - values = ('c-123', 'test_config', '', 'mysql', '5.6') + values = ('c-123', 'test_config', '', 'mysql', '5.6', "5.7.29") def setUp(self): super(TestConfigurationList, self).setUp() @@ -60,7 +60,7 @@ class TestConfigurationList(TestConfigurations): class TestConfigurationShow(TestConfigurations): - values = ('2015-05-16T10:24:28', 'mysql', '5.6', '', 'c-123', + values = ('2015-05-16T10:24:28', 'mysql', '5.6', '5.7.29', '', 'c-123', 'test_config', '2015-05-16T10:24:29', '{"max_connections": 5}') def setUp(self): @@ -73,6 +73,7 @@ class TestConfigurationShow(TestConfigurations): 'created', 'datastore_name', 'datastore_version_name', + 'datastore_version_number', 'description', 'id', 'name', @@ -205,7 +206,7 @@ class TestDatabaseConfigurationDelete(TestConfigurations): class TestConfigurationCreate(TestConfigurations): - values = ('2015-05-16T10:24:28', 'mysql', '5.6', '', 'c-123', + values = ('2015-05-16T10:24:28', 'mysql', '5.6', '5.7.29', '', 'c-123', 'test_config', '2015-05-16T10:24:29', '{"max_connections": 5}') def setUp(self): @@ -218,6 +219,7 @@ class TestConfigurationCreate(TestConfigurations): 'created', 'datastore_name', 'datastore_version_name', + 'datastore_version_number', 'description', 'id', 'name', @@ -229,7 +231,7 @@ class TestConfigurationCreate(TestConfigurations): args = ['c-123', '{"max_connections": 5}', '--description', 'test_config', '--datastore', 'mysql', - '--datastore_version', '5.6'] + '--datastore-version', '5.6'] parsed_args = self.check_parser(self.cmd, args, []) columns, data = self.cmd.take_action(parsed_args) self.assertEqual(self.columns, columns) @@ -244,13 +246,14 @@ class TestConfigurationCreate(TestConfigurations): '{"param1": 1, "param2": 2}', description=None, datastore=None, - datastore_version=None) + datastore_version=None, + datastore_version_number=None) def test_configuration_create_with_optional_args(self): args = ['cgroup2', '{"param3": 3, "param4": 4}', '--description', 'cgroup 2', '--datastore', 'mysql', - '--datastore_version', '5.6'] + '--datastore-version', '5.6'] parsed_args = self.check_parser(self.cmd, args, []) self.cmd.take_action(parsed_args) self.configuration_client.create.assert_called_with( @@ -258,7 +261,8 @@ class TestConfigurationCreate(TestConfigurations): '{"param3": 3, "param4": 4}', description='cgroup 2', datastore='mysql', - datastore_version='5.6') + datastore_version='5.6', + datastore_version_number=None) class TestConfigurationAttach(TestConfigurations): diff --git a/troveclient/tests/osc/v1/test_database_instances.py b/troveclient/tests/osc/v1/test_database_instances.py index af2134e..62c9a25 100644 --- a/troveclient/tests/osc/v1/test_database_instances.py +++ b/troveclient/tests/osc/v1/test_database_instances.py @@ -107,8 +107,8 @@ class TestInstanceList(TestInstances): class TestInstanceShow(TestInstances): values = ([{'address': '10.0.0.13', 'type': 'private'}], [], 'mysql', - '5.6', '02', '1234', 'test-member-1', False, 'regionOne', - 'fake_master_id', 'ACTIVE', 'fake_tenant_id', 2) + '5.6', '5.7.29', '02', '1234', 'test-member-1', False, + 'regionOne', 'fake_master_id', 'ACTIVE', 'fake_tenant_id', 2) def setUp(self): super(TestInstanceShow, self).setUp() @@ -120,6 +120,7 @@ class TestInstanceShow(TestInstances): 'allowed_cidrs', 'datastore', 'datastore_version', + 'datastore_version_number', 'flavor', 'id', 'name', @@ -197,13 +198,14 @@ class TestDatabaseInstanceDelete(TestInstances): class TestDatabaseInstanceCreate(TestInstances): - values = ('2017-12-22T20:02:32', 'mysql', '5.6', '310', + values = ('2017-12-22T20:02:32', 'mysql', '5.6', '5.7.29', '310', '2468', 'test', 'test-net', 'net-id', 'BUILD', '2017-12-22T20:02:32', 1) columns = ( 'created', 'datastore', 'datastore_version', + 'datastore_version_number', 'flavor', 'id', 'name', @@ -266,7 +268,8 @@ class TestDatabaseInstanceCreate(TestInstances): }, "datastore": { "type": "mysql", - "version": "5.7.29" + "version": "5.7.29", + "version_number": "5.7.29" }, "region": "RegionOne", "access": { @@ -310,6 +313,7 @@ class TestDatabaseInstanceCreate(TestInstances): 'created', 'datastore', 'datastore_version', + 'datastore_version_number', 'flavor', 'id', 'name', @@ -325,6 +329,7 @@ class TestDatabaseInstanceCreate(TestInstances): "2020-08-12T09:41:47", "mysql", "5.7.29", + "5.7.29", "a48ea749-7ee3-4003-8aae-eb4e79773e2d", "a1fea1cf-18ad-48ab-bdfd-fce99a4b834e", "test-mysql", @@ -363,6 +368,7 @@ class TestDatabaseInstanceCreate(TestInstances): availability_zone=None, datastore='mysql', datastore_version='5.7.29', + datastore_version_number=None, nics=[ {'network_id': 'net1', 'subnet_id': 'subnet_id', 'ip_address': '192.168.1.11'} diff --git a/troveclient/tests/osc/v1/test_datastores.py b/troveclient/tests/osc/v1/test_datastores.py index 5614963..e310749 100644 --- a/troveclient/tests/osc/v1/test_datastores.py +++ b/troveclient/tests/osc/v1/test_datastores.py @@ -88,7 +88,7 @@ class TestDeleteDatastore(TestDatastores): class TestDatastoreVersionList(TestDatastores): columns = datastores.ListDatastoreVersions.columns - values = ('v-56', '5.6') + values = ('v-56', '5.6', '') def setUp(self): super(TestDatastoreVersionList, self).setUp() @@ -173,7 +173,8 @@ class TestCreateDatastoreVersion(TestDatastores): self.dsversion_mgmt_client.create.assert_called_once_with( 'new_name', 'ds_name', 'ds_manager', image_id, active='true', - default='true', image_tags=['trove', 'mysql']) + default='true', image_tags=['trove', 'mysql'], + version_number=None) class TestUpdateDatastoreVersion(TestDatastores): @@ -191,4 +192,5 @@ class TestUpdateDatastoreVersion(TestDatastores): self.dsversion_mgmt_client.edit.assert_called_once_with( version_id, datastore_manager=None, image=None, - active='true', default='false', image_tags=['trove', 'mysql']) + active='true', default='false', image_tags=['trove', 'mysql'], + name=None) |