# Path: auto_forensicate/errors.py
# class BadConfigOption(Exception):
# class ForensicateError(Exception):
# class RecipeException(Exception):
# class RetryableError(ForensicateError):
# 
# Path: auto_forensicate/hostinfo.py
# def ReadDMI(name):
# def GetChassisSerial():
# def GetMachineUUID():
# def GetRandomUUID():
# def GetIdentifier():
# def GetUdevadmInfo(device_name):
# def GetTime():
# def Which(cmd):
# 
# Path: auto_forensicate/macdisk.py
# class MacDiskError(Exception):
# class Disk(object):
# def _DictFromSubprocess(command):
# def _DictFromDiskutilInfo(deviceid):
# def _DictFromDiskutilList():
# def WholeDisks():
#   def __init__(self, deviceid):
#   def Refresh(self):
# 
# Path: auto_forensicate/recipes/base.py
# class BaseArtifact(object):
# class StringArtifact(BaseArtifact):
# class FileArtifact(BaseArtifact):
# class ProcessOutputArtifact(BaseArtifact):
# class BaseRecipe(object):
#   def __init__(self, name):
#   def _GetStream(self):
#   def CloseStream(self):
#   def OpenStream(self):
#   def size(self):
#   def readable_size(self):
#   def __init__(self, path, string_content):
#   def _GetStream(self):
#   def CloseStream(self):
#   def __init__(self, path):
#   def _GetStream(self):
#   def __init__(self, command, path, ignore_failure=False):
#   def _RunCommand(self):
#   def _GetStream(self):
#   def __init__(self, name, options=None):
#   def __enter__(self):
#   def __exit__(self, exc_type, exc_value, traceback):
#   def GetArtifacts(self):
# 
# Path: auto_forensicate/recipes/disk.py
# class DiskArtifact(base.BaseArtifact):
# class MacDiskArtifact(DiskArtifact):
# class LinuxDiskArtifact(DiskArtifact):
# class DiskRecipe(base.BaseRecipe):
#   _DD_BINARY = 'dcfldd'
#   _DD_OPTIONS = ['hash=md5,sha1', 'bs=2M', 'conv=noerror', 'hashwindow=128M']
#   def __init__(self, path, size, use_dcfldd=True):
#   def _GenerateDDCommand(self):
#   def _GetStream(self):
#   def CloseStream(self):
#   def GetDescription(self):
#   def ProbablyADisk(self):
#   def __init__(self, path, size, use_dcfldd=True):
#   def _IsUsb(self):
#   def ProbablyADisk(self):
#   def __init__(self, path, size, use_dcfldd=True):
#   def GetDescription(self):
#   def _GetUdevadmProperty(self, prop):
#   def ProbablyADisk(self):
#   def _IsFloppy(self):
#   def _IsUsb(self):
#   def __init__(self, name, options=None):
#   def _GetLsblkDict(self):
#   def _ListAllDisksMac(self):
#   def _ListAllDisksLinux(self):
#   def _ListDisks(self, all_devices=False, names=None):
#   def _GetListDisksArtifact(self):
#   def _GetDiskInfoArtifact(self, disk):
#   def GetArtifacts(self):


import json
import unittest
import mock
from auto_forensicate import errors
from auto_forensicate import hostinfo
from auto_forensicate import macdisk
from auto_forensicate.recipes import base
from auto_forensicate.recipes import disk
                  'uuid': 'fake_uuid_2'},
             ]
            },
            {'name': 'usb0', 'maj:min': '8:16', 'rm': '1', 'size': '3000041824',
             'ro': '0', 'type': 'disk', 'mountpoint': None, 'uuid': None
            },
            {'name': 'sdy', 'maj:min': '8:0', 'rm': '0', 'size': '512110190592',
             'ro': '0', 'type': 'disk', 'mountpoint': None, 'uuid': None,
             'children': [
                 {'name': 'sdy1', 'maj:min': '8:1', 'rm': '0',
                  'size': '48725121', 'ro': '0', 'type': 'part',
                  'mountpoint': '/boot', 'uuid': None},
             ]
            }
        ]
    }

  def _GetLsblkDictZeroDisks(self):
    return {'blockdevices': []}

  def _GetLsblkDictThreeDisks(self):
    return self._lsblk_dict

  def testListDisksZero(self):
    recipe = disk.DiskRecipe('Disk')
    recipe._platform = 'linux'
    disk.DiskRecipe._GetLsblkDict = self._GetLsblkDictZeroDisks
    self.assertEqual(0, len(recipe._ListDisks()))

  def testListAllDisks(self):

# Path: auto_forensicate/errors.py
# class BadConfigOption(Exception):
# class ForensicateError(Exception):
# class RecipeException(Exception):
# class RetryableError(ForensicateError):
# 
# Path: auto_forensicate/hostinfo.py
# def ReadDMI(name):
# def GetChassisSerial():
# def GetMachineUUID():
# def GetRandomUUID():
# def GetIdentifier():
# def GetUdevadmInfo(device_name):
# def GetTime():
# def Which(cmd):
# 
# Path: auto_forensicate/macdisk.py
# class MacDiskError(Exception):
# class Disk(object):
# def _DictFromSubprocess(command):
# def _DictFromDiskutilInfo(deviceid):
# def _DictFromDiskutilList():
# def WholeDisks():
#   def __init__(self, deviceid):
#   def Refresh(self):
# 
# Path: auto_forensicate/recipes/base.py
# class BaseArtifact(object):
# class StringArtifact(BaseArtifact):
# class FileArtifact(BaseArtifact):
# class ProcessOutputArtifact(BaseArtifact):
# class BaseRecipe(object):
#   def __init__(self, name):
#   def _GetStream(self):
#   def CloseStream(self):
#   def OpenStream(self):
#   def size(self):
#   def readable_size(self):
#   def __init__(self, path, string_content):
#   def _GetStream(self):
#   def CloseStream(self):
#   def __init__(self, path):
#   def _GetStream(self):
#   def __init__(self, command, path, ignore_failure=False):
#   def _RunCommand(self):
#   def _GetStream(self):
#   def __init__(self, name, options=None):
#   def __enter__(self):
#   def __exit__(self, exc_type, exc_value, traceback):
#   def GetArtifacts(self):
# 
# Path: auto_forensicate/recipes/disk.py
# class DiskArtifact(base.BaseArtifact):
# class MacDiskArtifact(DiskArtifact):
# class LinuxDiskArtifact(DiskArtifact):
# class DiskRecipe(base.BaseRecipe):
#   _DD_BINARY = 'dcfldd'
#   _DD_OPTIONS = ['hash=md5,sha1', 'bs=2M', 'conv=noerror', 'hashwindow=128M']
#   def __init__(self, path, size, use_dcfldd=True):
#   def _GenerateDDCommand(self):
#   def _GetStream(self):
#   def CloseStream(self):
#   def GetDescription(self):
#   def ProbablyADisk(self):
#   def __init__(self, path, size, use_dcfldd=True):
#   def _IsUsb(self):
#   def ProbablyADisk(self):
#   def __init__(self, path, size, use_dcfldd=True):
#   def GetDescription(self):
#   def _GetUdevadmProperty(self, prop):
#   def ProbablyADisk(self):
#   def _IsFloppy(self):
#   def _IsUsb(self):
#   def __init__(self, name, options=None):
#   def _GetLsblkDict(self):
#   def _ListAllDisksMac(self):
#   def _ListAllDisksLinux(self):
#   def _ListDisks(self, all_devices=False, names=None):
#   def _GetListDisksArtifact(self):
#   def _GetDiskInfoArtifact(self, disk):
#   def GetArtifacts(self):


# Path: tests/disk_tests.py
import json
import unittest
import mock
from auto_forensicate import errors
from auto_forensicate import hostinfo
from auto_forensicate import macdisk
from auto_forensicate.recipes import base
from auto_forensicate.recipes import disk

                  'uuid': 'fake_uuid_2'},
             ]
            },
            {'name': 'usb0', 'maj:min': '8:16', 'rm': '1', 'size': '3000041824',
             'ro': '0', 'type': 'disk', 'mountpoint': None, 'uuid': None
            },
            {'name': 'sdy', 'maj:min': '8:0', 'rm': '0', 'size': '512110190592',
             'ro': '0', 'type': 'disk', 'mountpoint': None, 'uuid': None,
             'children': [
                 {'name': 'sdy1', 'maj:min': '8:1', 'rm': '0',
                  'size': '48725121', 'ro': '0', 'type': 'part',
                  'mountpoint': '/boot', 'uuid': None},
             ]
            }
        ]
    }

  def _GetLsblkDictZeroDisks(self):
    return {'blockdevices': []}

  def _GetLsblkDictThreeDisks(self):
    return self._lsblk_dict

  def testListDisksZero(self):
    recipe = disk.DiskRecipe('Disk')
    recipe._platform = 'linux'
    disk.DiskRecipe._GetLsblkDict = self._GetLsblkDictZeroDisks
    self.assertEqual(0, len(recipe._ListDisks()))

  def testListAllDisks(self):

    recipe = disk.DiskRecipe('Disk')