# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.containerinstance import ContainerInstanceManagementClient

from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy

AZURE_LOCATION = "eastus"


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestContainerInstanceManagementContainerGroupsOperations(AzureMgmtRecordedTestCase):
    def setup_method(self, method):
        self.client = self.create_mgmt_client(ContainerInstanceManagementClient)

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_container_groups_get(self, resource_group):
        response = self.client.container_groups.get(
            resource_group_name=resource_group.name,
            container_group_name="str",
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_container_groups_begin_create_or_update(self, resource_group):
        response = self.client.container_groups.begin_create_or_update(
            resource_group_name=resource_group.name,
            container_group_name="str",
            container_group={
                "properties": {
                    "containers": [
                        {
                            "name": "str",
                            "properties": {
                                "command": ["str"],
                                "configMap": {"keyValuePairs": {"str": "str"}},
                                "environmentVariables": [
                                    {"name": "str", "secureValue": "str", "secureValueReference": "str", "value": "str"}
                                ],
                                "image": "str",
                                "instanceView": {
                                    "currentState": {
                                        "detailStatus": "str",
                                        "exitCode": 0,
                                        "finishTime": "2020-02-20 00:00:00",
                                        "startTime": "2020-02-20 00:00:00",
                                        "state": "str",
                                    },
                                    "events": [
                                        {
                                            "count": 0,
                                            "firstTimestamp": "2020-02-20 00:00:00",
                                            "lastTimestamp": "2020-02-20 00:00:00",
                                            "message": "str",
                                            "name": "str",
                                            "type": "str",
                                        }
                                    ],
                                    "previousState": {
                                        "detailStatus": "str",
                                        "exitCode": 0,
                                        "finishTime": "2020-02-20 00:00:00",
                                        "startTime": "2020-02-20 00:00:00",
                                        "state": "str",
                                    },
                                    "restartCount": 0,
                                },
                                "livenessProbe": {
                                    "exec": {"command": ["str"]},
                                    "failureThreshold": 0,
                                    "httpGet": {
                                        "port": 0,
                                        "httpHeaders": [{"name": "str", "value": "str"}],
                                        "path": "str",
                                        "scheme": "str",
                                    },
                                    "initialDelaySeconds": 0,
                                    "periodSeconds": 0,
                                    "successThreshold": 0,
                                    "timeoutSeconds": 0,
                                },
                                "ports": [{"port": 0, "protocol": "str"}],
                                "readinessProbe": {
                                    "exec": {"command": ["str"]},
                                    "failureThreshold": 0,
                                    "httpGet": {
                                        "port": 0,
                                        "httpHeaders": [{"name": "str", "value": "str"}],
                                        "path": "str",
                                        "scheme": "str",
                                    },
                                    "initialDelaySeconds": 0,
                                    "periodSeconds": 0,
                                    "successThreshold": 0,
                                    "timeoutSeconds": 0,
                                },
                                "resources": {
                                    "requests": {"cpu": 0.0, "memoryInGB": 0.0, "gpu": {"count": 0, "sku": "str"}},
                                    "limits": {"cpu": 0.0, "gpu": {"count": 0, "sku": "str"}, "memoryInGB": 0.0},
                                },
                                "securityContext": {
                                    "allowPrivilegeEscalation": bool,
                                    "capabilities": {"add": ["str"], "drop": ["str"]},
                                    "privileged": bool,
                                    "runAsGroup": 0,
                                    "runAsUser": 0,
                                    "seccompProfile": "str",
                                },
                                "volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}],
                            },
                        }
                    ],
                    "confidentialComputeProperties": {"ccePolicy": "str"},
                    "containerGroupProfile": {"id": "str", "revision": 0},
                    "diagnostics": {
                        "logAnalytics": {
                            "workspaceId": "str",
                            "workspaceKey": "str",
                            "logType": "str",
                            "metadata": {"str": "str"},
                            "workspaceResourceId": "str",
                        }
                    },
                    "dnsConfig": {"nameServers": ["str"], "options": "str", "searchDomains": "str"},
                    "encryptionProperties": {
                        "keyName": "str",
                        "keyVersion": "str",
                        "vaultBaseUrl": "str",
                        "identity": "str",
                    },
                    "extensions": [
                        {
                            "name": "str",
                            "properties": {
                                "extensionType": "str",
                                "version": "str",
                                "protectedSettings": {},
                                "settings": {},
                            },
                        }
                    ],
                    "identityAcls": {"acls": [{"access": "str", "identity": "str"}], "defaultAccess": "str"},
                    "imageRegistryCredentials": [
                        {
                            "server": "str",
                            "identity": "str",
                            "identityUrl": "str",
                            "password": "str",
                            "passwordReference": "str",
                            "username": "str",
                        }
                    ],
                    "initContainers": [
                        {
                            "name": "str",
                            "properties": {
                                "command": ["str"],
                                "environmentVariables": [
                                    {"name": "str", "secureValue": "str", "secureValueReference": "str", "value": "str"}
                                ],
                                "image": "str",
                                "instanceView": {
                                    "currentState": {
                                        "detailStatus": "str",
                                        "exitCode": 0,
                                        "finishTime": "2020-02-20 00:00:00",
                                        "startTime": "2020-02-20 00:00:00",
                                        "state": "str",
                                    },
                                    "events": [
                                        {
                                            "count": 0,
                                            "firstTimestamp": "2020-02-20 00:00:00",
                                            "lastTimestamp": "2020-02-20 00:00:00",
                                            "message": "str",
                                            "name": "str",
                                            "type": "str",
                                        }
                                    ],
                                    "previousState": {
                                        "detailStatus": "str",
                                        "exitCode": 0,
                                        "finishTime": "2020-02-20 00:00:00",
                                        "startTime": "2020-02-20 00:00:00",
                                        "state": "str",
                                    },
                                    "restartCount": 0,
                                },
                                "securityContext": {
                                    "allowPrivilegeEscalation": bool,
                                    "capabilities": {"add": ["str"], "drop": ["str"]},
                                    "privileged": bool,
                                    "runAsGroup": 0,
                                    "runAsUser": 0,
                                    "seccompProfile": "str",
                                },
                                "volumeMounts": [{"mountPath": "str", "name": "str", "readOnly": bool}],
                            },
                        }
                    ],
                    "instanceView": {
                        "events": [
                            {
                                "count": 0,
                                "firstTimestamp": "2020-02-20 00:00:00",
                                "lastTimestamp": "2020-02-20 00:00:00",
                                "message": "str",
                                "name": "str",
                                "type": "str",
                            }
                        ],
                        "state": "str",
                    },
                    "ipAddress": {
                        "ports": [{"port": 0, "protocol": "str"}],
                        "type": "str",
                        "autoGeneratedDomainNameLabelScope": "str",
                        "dnsNameLabel": "str",
                        "fqdn": "str",
                        "ip": "str",
                    },
                    "isCreatedFromStandbyPool": bool,
                    "osType": "str",
                    "priority": "str",
                    "provisioningState": "str",
                    "restartPolicy": "str",
                    "secretReferences": [{"identity": "str", "name": "str", "secretReferenceUri": "str"}],
                    "sku": "str",
                    "standbyPoolProfile": {"failContainerGroupCreateOnReuseFailure": bool, "id": "str"},
                    "subnetIds": [{"id": "str", "name": "str"}],
                    "volumes": [
                        {
                            "name": "str",
                            "azureFile": {
                                "shareName": "str",
                                "storageAccountName": "str",
                                "readOnly": bool,
                                "storageAccountKey": "str",
                                "storageAccountKeyReference": "str",
                            },
                            "emptyDir": {},
                            "gitRepo": {"repository": "str", "directory": "str", "revision": "str"},
                            "secret": {"str": "str"},
                            "secretReference": {"str": "str"},
                        }
                    ],
                },
                "id": "str",
                "identity": {
                    "principalId": "str",
                    "tenantId": "str",
                    "type": "str",
                    "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
                },
                "location": "str",
                "name": "str",
                "systemData": {
                    "createdAt": "2020-02-20 00:00:00",
                    "createdBy": "str",
                    "createdByType": "str",
                    "lastModifiedAt": "2020-02-20 00:00:00",
                    "lastModifiedBy": "str",
                    "lastModifiedByType": "str",
                },
                "tags": {"str": "str"},
                "type": "str",
                "zones": ["str"],
            },
        ).result()  # call '.result()' to poll until service return final result

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_container_groups_update(self, resource_group):
        response = self.client.container_groups.update(
            resource_group_name=resource_group.name,
            container_group_name="str",
            resource={
                "id": "str",
                "location": "str",
                "name": "str",
                "tags": {"str": "str"},
                "type": "str",
                "zones": ["str"],
            },
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_container_groups_begin_delete(self, resource_group):
        response = self.client.container_groups.begin_delete(
            resource_group_name=resource_group.name,
            container_group_name="str",
        ).result()  # call '.result()' to poll until service return final result

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_container_groups_begin_restart(self, resource_group):
        response = self.client.container_groups.begin_restart(
            resource_group_name=resource_group.name,
            container_group_name="str",
        ).result()  # call '.result()' to poll until service return final result

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_container_groups_stop(self, resource_group):
        response = self.client.container_groups.stop(
            resource_group_name=resource_group.name,
            container_group_name="str",
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_container_groups_begin_start(self, resource_group):
        response = self.client.container_groups.begin_start(
            resource_group_name=resource_group.name,
            container_group_name="str",
        ).result()  # call '.result()' to poll until service return final result

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_container_groups_get_outbound_network_dependencies_endpoints(self, resource_group):
        response = self.client.container_groups.get_outbound_network_dependencies_endpoints(
            resource_group_name=resource_group.name,
            container_group_name="str",
        )

        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_container_groups_list(self, resource_group):
        response = self.client.container_groups.list()
        result = [r for r in response]
        # please add some check logic here by yourself
        # ...

    @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
    @recorded_by_proxy
    def test_container_groups_list_by_resource_group(self, resource_group):
        response = self.client.container_groups.list_by_resource_group(
            resource_group_name=resource_group.name,
        )
        result = [r for r in response]
        # please add some check logic here by yourself
        # ...
