Skip to content

Commit

Permalink
style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DaeunYim committed Jun 24, 2021
1 parent 656af4b commit f7d73f2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ def database_delete_func(client, resource_group_name=None, server_name=None, dat
"If your parameter persistence is turned OFF, consider passing them explicitly.")
if not yes:
user_confirmation(
"Are you sure you want to delete the database '{0}' of server name '{1}'".format(database_name,
server_name), yes=yes)
"Are you sure you want to delete the database '{0}' of server '{1}'".format(database_name,
server_name), yes=yes)

try:
result = client.begin_delete(resource_group_name, server_name, database_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def flexible_server_restore(cmd, client,
id_parts = parse_resource_id(source_server_id)
source_server_object = client.get(id_parts['resource_group'], id_parts['name'])
parameters.location = source_server_object.location

if source_server_object.public_network_access == 'Disabled':
setup_restore_network(cmd=cmd,
resource_group_name=resource_group_name,
Expand Down Expand Up @@ -211,7 +211,7 @@ def setup_restore_network(cmd, resource_group_name, server_name, location, param
else:
for delgtn in subnet.delegations:
if delgtn.service_name != DELEGATION_SERVICE_NAME:
raise CLIError("Can not use subnet with existing delegations other than {}".format(DELEGATION_SERVICE_NAME))
raise CLIError("Can not use subnet with existing delegations other than {}".format(DELEGATION_SERVICE_NAME))
parameters.delegated_subnet_arguments = postgresql_flexibleservers.models.ServerPropertiesDelegatedSubnetArguments(subnet_arm_resource_id=subnet_id)
else:
raise ResourceNotFoundError("The subnet does not exist. Please verify the subnet Id.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,57 +176,6 @@ def test_mysql_flexible_server_iops_delete(self):
self.cmd('az group delete --name {} --yes --no-wait'.format(self.resource_group))


class MySqlFlexibleServerVnetServerMgmtScenarioTest(FlexibleServerVnetServerMgmtScenarioTest):

def __init__(self, method_name):
super(MySqlFlexibleServerVnetServerMgmtScenarioTest, self).__init__(method_name)
self.location = mysql_location
self.resource_group = self.create_random_name(RG_NAME_PREFIX, RG_NAME_MAX_LENGTH)
self.server = self.create_random_name(SERVER_NAME_PREFIX, SERVER_NAME_MAX_LENGTH)
self.server_2 = self.create_random_name(SERVER_NAME_PREFIX + '2', SERVER_NAME_MAX_LENGTH)
self.restore_server = 'restore-' + self.server[:55]
self.restore_server_2 = 'restore-' + self.server_2[:55]

@pytest.mark.order(1)
def test_mysql_flexible_server_vnet_server_prepare(self):
self.cmd('az group create --location {} --name {}'.format(mysql_location, self.resource_group))

@AllowLargeResponse()
@pytest.mark.order(2)
def test_mysql_flexible_server_vnet_server_create(self):
self._test_flexible_server_vnet_server_create('mysql', self.resource_group, self.server)

@AllowLargeResponse()
@pytest.mark.order(3)
def test_mysql_flexible_server_vnet_server_update_scale_up(self):
self._test_flexible_server_vnet_server_update_scale_up('mysql', self.resource_group, self.server)

@AllowLargeResponse()
@pytest.mark.order(4)
def test_mysql_flexible_server_vnet_server_restore(self):
self._test_flexible_server_vnet_server_restore('mysql', self.resource_group, self.server, self.restore_server)

@AllowLargeResponse()
@pytest.mark.order(5)
def test_mysql_flexible_server_vnet_ha_server_create(self):
self._test_flexible_server_vnet_ha_server_create('mysql', self.resource_group, self.server_2)

@AllowLargeResponse()
@pytest.mark.order(6)
def test_mysql_flexible_server_vnet_ha_server_update_scale_up(self):
self._test_flexible_server_vnet_server_update_scale_up('mysql', self.resource_group, self.server_2)

@AllowLargeResponse()
@pytest.mark.order(7)
def test_mysql_flexible_server_vnet_ha_server_delete(self):
self._test_flexible_server_vnet_server_delete('mysql', self.resource_group, self.server_2)

@AllowLargeResponse()
@pytest.mark.order(8)
def test_mysql_flexible_server_vnet_server_delete(self):
self._test_flexible_server_vnet_server_delete('mysql', self.resource_group, self.server, self.restore_server)


class MySqlFlexibleServerProxyResourceMgmtScenarioTest(FlexibleServerProxyResourceMgmtScenarioTest):

mysql_location = mysql_location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,66 +214,6 @@ def test_postgres_flexible_server_high_availability_delete(self):
self._test_flexible_server_high_availability_delete(self.resource_group)


class PostgresFlexibleServerVnetServerMgmtScenarioTest(FlexibleServerVnetServerMgmtScenarioTest):

def __init__(self, method_name):
super(PostgresFlexibleServerVnetServerMgmtScenarioTest, self).__init__(method_name)
self.location = postgres_location
self.resource_group = self.create_random_name(RG_NAME_PREFIX, RG_NAME_MAX_LENGTH)
self.server = self.create_random_name(SERVER_NAME_PREFIX, SERVER_NAME_MAX_LENGTH)
self.server_2 = self.create_random_name(SERVER_NAME_PREFIX + '2', SERVER_NAME_MAX_LENGTH)
self.restore_server = 'restore-' + self.server[:55]
self.restore_server_2 = 'restore-' + self.server_2[:55]

@pytest.mark.order(1)
def test_postgres_flexible_server_vnet_server_prepare(self):
self.cmd('az group create --location {} --name {}'.format(postgres_location, self.resource_group))

@AllowLargeResponse()
@pytest.mark.order(2)
def test_postgres_flexible_server_vnet_server_create(self):
self._test_flexible_server_vnet_server_create('postgres', self.resource_group, self.server)

@AllowLargeResponse()
@pytest.mark.order(3)
def test_postgres_flexible_server_vnet_server_update_scale_up(self):
self._test_flexible_server_vnet_server_update_scale_up('postgres', self.resource_group, self.server)

@AllowLargeResponse()
@pytest.mark.order(4)
def test_postgres_flexible_server_vnet_server_restore(self):
self._test_flexible_server_vnet_server_restore('postgres', self.resource_group, self.server, self.restore_server)

@AllowLargeResponse()
@pytest.mark.order(5)
def test_postgres_flexible_server_vnet_server_delete(self):
self._test_flexible_server_vnet_server_delete('postgres', self.resource_group, self.server, self.restore_server)

@AllowLargeResponse()
@pytest.mark.order(6)
def test_postgres_flexible_server_vnet_ha_server_create(self):
self._test_flexible_server_vnet_ha_server_create('postgres', self.resource_group, self.server_2)

@AllowLargeResponse()
@pytest.mark.order(7)
def test_postgres_flexible_server_vnet_ha_server_update_scale_up(self):
self._test_flexible_server_vnet_server_update_scale_up('postgres', self.resource_group, self.server_2)

@AllowLargeResponse()
@pytest.mark.order(8)
def test_postgres_flexible_server_vnet_ha_server_restore(self):
self._test_flexible_server_vnet_server_restore('postgres', self.resource_group, self.server_2, self.restore_server_2)

@AllowLargeResponse()
@pytest.mark.order(9)
def test_postgres_flexible_server_vnet_ha_server_delete(self):
self._test_flexible_server_vnet_server_delete('postgres', self.resource_group, self.server_2, self.restore_server_2)

@pytest.mark.order(10)
def test_postgres_flexible_server_vnet_server_mgmt_delete(self):
self._test_flexible_server_vnet_server_mgmt_delete(self.resource_group)


class PostgresFlexibleServerProxyResourceMgmtScenarioTest(FlexibleServerProxyResourceMgmtScenarioTest):

postgres_location = postgres_location
Expand Down

0 comments on commit f7d73f2

Please sign in to comment.