# Path: libcloudforensics/logging_utils.py
# def _GenerateColorSequences() -> List[str]:
#   def __init__(self,
#                colorize: bool = True,
#                random_color: bool = False,
#                **kwargs: str) -> None:
#   def format(self, record: logging.LogRecord) -> str:
# def SetUpLogger(name: str, no_newline: bool = False) -> None:
# def GetLogger(name: str) -> logging.Logger:
# COLOR_SEQS = _GenerateColorSequences()
# RESET_SEQ = '\u001b[0m'
# BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = COLOR_SEQS[8:16]
# BG_RED = '\u001b[41m'  # Red background
# BOLD = '\u001b[1m'  # Bold / bright modifier
# LOG_FORMAT = ('[%(asctime)s] [{0:s}{color:s}%(name)-20s{1:s}] %(levelname)-8s'
#               ' %(message)s')
# LEVEL_COLOR_MAP = {
#     'WARNING': YELLOW,
#     'INFO': WHITE,
#     'DEBUG': BLUE,
#     'CRITICAL': BOLD + BG_RED + WHITE,
#     'ERROR': RED
# }
# class Formatter(logging.Formatter):
# 
# Path: libcloudforensics/providers/azure/internal/account.py
# class AZAccount:
#   def __init__(self,
#                default_resource_group_name: str,
#                default_region: str = 'eastus',
#                profile_name: Optional[str] = None) -> None:
#   def compute(self) -> compute_module.AZCompute:
#   def monitoring(self) -> monitoring_module.AZMonitoring:
#   def network(self) -> network_module.AZNetwork:
#   def resource(self) -> resource_module.AZResource:
#   def storage(self) -> storage_module.AZStorage:
# 
# Path: libcloudforensics/providers/azure/forensics.py
# def CreateDiskCopy(
#     resource_group_name: str,
#     instance_name: Optional[str] = None,
#     disk_name: Optional[str] = None,
#     disk_type: Optional[str] = None,
#     region: str = 'eastus',
#     src_profile: Optional[str] = None,
#     dst_profile: Optional[str] = None) -> 'compute.AZComputeDisk':
# def StartAnalysisVm(
#     resource_group_name: str,
#     vm_name: str,
#     boot_disk_size: int,
#     ssh_public_key: str,
#     cpu_cores: int = 4,
#     memory_in_mb: int = 8192,
#     region: str = 'eastus',
#     attach_disks: Optional[List[str]] = None,
#     tags: Optional[Dict[str, str]] = None,
#     dst_profile: Optional[str] = None
#     ) -> Tuple['compute.AZComputeVirtualMachine', bool]:
# 
# Path: tests/scripts/utils.py
# def ReadProjectInfo(keys: List[str]) -> Dict[str, str]:


import typing
import unittest
from time import sleep
from msrestazure import azure_exceptions  # pylint: disable=import-error
from libcloudforensics import logging_utils
from libcloudforensics.providers.azure.internal import account
from libcloudforensics.providers.azure import forensics
from tests.scripts import utils
  # pylint: enable=line-too-long

  @classmethod
  @typing.no_type_check
  def setUpClass(cls):
    try:
      project_info = utils.ReadProjectInfo(
          ['resource_group_name', 'instance_name', 'ssh_public_key'])
    except (OSError, RuntimeError, ValueError) as exception:
      raise unittest.SkipTest(str(exception))
    cls.resource_group_name = project_info['resource_group_name']
    cls.instance_to_analyse = project_info['instance_name']
    cls.ssh_public_key = project_info['ssh_public_key']
    cls.disk_to_copy = project_info.get('disk_name')
    cls.dst_region = project_info.get('dst_region')
    cls.az = account.AZAccount(cls.resource_group_name)
    cls.analysis_vm_name = 'new-vm-for-analysis'
    cls.analysis_vm, _ = forensics.StartAnalysisVm(cls.resource_group_name,
                                                   cls.analysis_vm_name,
                                                   50,
                                                   cls.ssh_public_key)
    cls.disks = []  # List of AZDisks for test cleanup

  @typing.no_type_check
  def testBootDiskCopy(self):
    """End to end test on Azure.

    Test copying the boot disk of an instance.
    """


# Path: libcloudforensics/logging_utils.py
# def _GenerateColorSequences() -> List[str]:
#   def __init__(self,
#                colorize: bool = True,
#                random_color: bool = False,
#                **kwargs: str) -> None:
#   def format(self, record: logging.LogRecord) -> str:
# def SetUpLogger(name: str, no_newline: bool = False) -> None:
# def GetLogger(name: str) -> logging.Logger:
# COLOR_SEQS = _GenerateColorSequences()
# RESET_SEQ = '\u001b[0m'
# BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = COLOR_SEQS[8:16]
# BG_RED = '\u001b[41m'  # Red background
# BOLD = '\u001b[1m'  # Bold / bright modifier
# LOG_FORMAT = ('[%(asctime)s] [{0:s}{color:s}%(name)-20s{1:s}] %(levelname)-8s'
#               ' %(message)s')
# LEVEL_COLOR_MAP = {
#     'WARNING': YELLOW,
#     'INFO': WHITE,
#     'DEBUG': BLUE,
#     'CRITICAL': BOLD + BG_RED + WHITE,
#     'ERROR': RED
# }
# class Formatter(logging.Formatter):
# 
# Path: libcloudforensics/providers/azure/internal/account.py
# class AZAccount:
#   def __init__(self,
#                default_resource_group_name: str,
#                default_region: str = 'eastus',
#                profile_name: Optional[str] = None) -> None:
#   def compute(self) -> compute_module.AZCompute:
#   def monitoring(self) -> monitoring_module.AZMonitoring:
#   def network(self) -> network_module.AZNetwork:
#   def resource(self) -> resource_module.AZResource:
#   def storage(self) -> storage_module.AZStorage:
# 
# Path: libcloudforensics/providers/azure/forensics.py
# def CreateDiskCopy(
#     resource_group_name: str,
#     instance_name: Optional[str] = None,
#     disk_name: Optional[str] = None,
#     disk_type: Optional[str] = None,
#     region: str = 'eastus',
#     src_profile: Optional[str] = None,
#     dst_profile: Optional[str] = None) -> 'compute.AZComputeDisk':
# def StartAnalysisVm(
#     resource_group_name: str,
#     vm_name: str,
#     boot_disk_size: int,
#     ssh_public_key: str,
#     cpu_cores: int = 4,
#     memory_in_mb: int = 8192,
#     region: str = 'eastus',
#     attach_disks: Optional[List[str]] = None,
#     tags: Optional[Dict[str, str]] = None,
#     dst_profile: Optional[str] = None
#     ) -> Tuple['compute.AZComputeVirtualMachine', bool]:
# 
# Path: tests/scripts/utils.py
# def ReadProjectInfo(keys: List[str]) -> Dict[str, str]:


# Path: tests/providers/azure/e2e.py
import typing
import unittest
from time import sleep
from msrestazure import azure_exceptions  # pylint: disable=import-error
from libcloudforensics import logging_utils
from libcloudforensics.providers.azure.internal import account
from libcloudforensics.providers.azure import forensics
from tests.scripts import utils

  # pylint: enable=line-too-long

  @classmethod
  @typing.no_type_check
  def setUpClass(cls):
    try:
      project_info = utils.ReadProjectInfo(
          ['resource_group_name', 'instance_name', 'ssh_public_key'])
    except (OSError, RuntimeError, ValueError) as exception:
      raise unittest.SkipTest(str(exception))
    cls.resource_group_name = project_info['resource_group_name']
    cls.instance_to_analyse = project_info['instance_name']
    cls.ssh_public_key = project_info['ssh_public_key']
    cls.disk_to_copy = project_info.get('disk_name')
    cls.dst_region = project_info.get('dst_region')
    cls.az = account.AZAccount(cls.resource_group_name)
    cls.analysis_vm_name = 'new-vm-for-analysis'
    cls.analysis_vm, _ = forensics.StartAnalysisVm(cls.resource_group_name,
                                                   cls.analysis_vm_name,
                                                   50,
                                                   cls.ssh_public_key)
    cls.disks = []  # List of AZDisks for test cleanup

  @typing.no_type_check
  def testBootDiskCopy(self):
    """End to end test on Azure.

    Test copying the boot disk of an instance.
    """


    disk_copy = forensics.CreateDiskCopy(