# Path: auto_forensicate/auto_acquire.py
# VALID_RECIPES = {
#     'directory': directory.DirectoryRecipe,
#     'disk': disk.DiskRecipe,
#     'firmware': firmware.ChipsecRecipe,
#     'sysinfo': sysinfo.SysinfoRecipe
# }
# DEFAULT_RECIPES = frozenset({'disk', 'firmware', 'sysinfo'})
# ARTIFACT_MIN_REPORTING_SIZE = 1024**3
# def HumanReadableBytes(byte_val, prefix='dec'):
#   def update_with_total(self, _unused_current_bytes, _unused_total_bytes):
#   def _Update(self, current_bytes):
#   def speed(self):
#   def update_with_total(self, current_bytes, _unused_total_bytes):
#   def __init__(self, artifact, progress_logger, reporting_frequency=5):
#   def _CheckReportable(self, percentage):
#   def update_with_total(self, current_bytes, _unused_total_bytes):
#   def __init__(self):
#   def RegisterCallback(self, callback):
#   def update_with_total(self, current_bytes, total_bytes):
#   def __init__(self, recipes=None):
#   def _CreateParser(self):
#   def _ParseLoggingArguments(self, options):
#   def _MakeUploader(self, options):
#   def ParseArguments(self, args):
#   def _ParseRecipes(self, options):
#   def _ParseGCSJSON(self, options):
#   def _MakeProgressBar(self, max_size, name, message=None):
#   def _MakeGCPProgressReporter(self, artifact):
#   def Do(self, recipe):
#   def _UploadArtifact(self, artifact, update_callback=None):
#   def _UploadArtifacts(self, artifacts):
#   def _Colorize(self, color, msg):
#   def Main(self, args=None):
# class SpinnerBar(Spinner):
# class BaBar(IncrementalBar):
# class GCPProgressReporter:
# class BotoCallbackHandler:
# class AutoForensicate(object):
# 
# Path: auto_forensicate/errors.py
# class BadConfigOption(Exception):
# class ForensicateError(Exception):
# class RecipeException(Exception):
# class RetryableError(ForensicateError):
# 
# Path: auto_forensicate/uploader.py
# class BaseUploader(object):
# class LocalCopier(BaseUploader):
# class GCSUploader(BaseUploader):
#   def __init__(self, stamp_manager, stamp=None):
#   def _UploadStamp(self):
#   def _MakeRemotePath(self, destination):
#   def _UploadStream(self, stream, remote_path, update_callback=None):
#   def UploadArtifact(self, artifact, update_callback=None):
#   def __init__(self, destination_dir, stamp_manager, stamp=None):
#   def _UploadStream(self, stream, remote_path, update_callback=None):
#   def _MakeRemotePath(self, destination):
#   def __init__(self, gs_url, gs_keyfile, client_id, stamp_manager, stamp=None):
#   def _InitBoto(self):
#   def _SplitGCSUrl(self):
#   def _MakeRemotePath(self, destination):
#   def _UploadStream(self, stream, remote_path, update_callback=None):
# 
# 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):


import argparse
import logging
import os
import sys
import tempfile
import unittest
import mock
from six import StringIO
from auto_forensicate import auto_acquire
from auto_forensicate import errors
from auto_forensicate import uploader
from auto_forensicate.recipes import base
        'test1': None,
        'test2': None
    }
    test_args = ['--acquire', 'test1', 'nfs://destination']
    af = auto_acquire.AutoForensicate(recipes=recipes)
    parser = af._CreateParser()
    options = parser.parse_args(test_args)
    expected_recipes = ['test1']
    self.assertEqual(options.acquire, expected_recipes)

  def testParseAcquireBad(self):
    recipes = {
        'test1': None,
        'test2': None
    }
    af = auto_acquire.AutoForensicate(recipes=recipes)
    test_args = [
        '--acquire', 'test4', '--acquire', 'all',
        '--gs_keyfile=file', 'gs://bucket']
    prev_stderr = sys.stderr
    sys.stderr = StringIO()
    with self.assertRaises(SystemExit):
      af.ParseArguments(test_args)
    sys.stderr = prev_stderr

  def testParseAcquireAll(self):
    recipes = {
        'test1': None,
        'test2': None
    }

# Path: auto_forensicate/auto_acquire.py
# VALID_RECIPES = {
#     'directory': directory.DirectoryRecipe,
#     'disk': disk.DiskRecipe,
#     'firmware': firmware.ChipsecRecipe,
#     'sysinfo': sysinfo.SysinfoRecipe
# }
# DEFAULT_RECIPES = frozenset({'disk', 'firmware', 'sysinfo'})
# ARTIFACT_MIN_REPORTING_SIZE = 1024**3
# def HumanReadableBytes(byte_val, prefix='dec'):
#   def update_with_total(self, _unused_current_bytes, _unused_total_bytes):
#   def _Update(self, current_bytes):
#   def speed(self):
#   def update_with_total(self, current_bytes, _unused_total_bytes):
#   def __init__(self, artifact, progress_logger, reporting_frequency=5):
#   def _CheckReportable(self, percentage):
#   def update_with_total(self, current_bytes, _unused_total_bytes):
#   def __init__(self):
#   def RegisterCallback(self, callback):
#   def update_with_total(self, current_bytes, total_bytes):
#   def __init__(self, recipes=None):
#   def _CreateParser(self):
#   def _ParseLoggingArguments(self, options):
#   def _MakeUploader(self, options):
#   def ParseArguments(self, args):
#   def _ParseRecipes(self, options):
#   def _ParseGCSJSON(self, options):
#   def _MakeProgressBar(self, max_size, name, message=None):
#   def _MakeGCPProgressReporter(self, artifact):
#   def Do(self, recipe):
#   def _UploadArtifact(self, artifact, update_callback=None):
#   def _UploadArtifacts(self, artifacts):
#   def _Colorize(self, color, msg):
#   def Main(self, args=None):
# class SpinnerBar(Spinner):
# class BaBar(IncrementalBar):
# class GCPProgressReporter:
# class BotoCallbackHandler:
# class AutoForensicate(object):
# 
# Path: auto_forensicate/errors.py
# class BadConfigOption(Exception):
# class ForensicateError(Exception):
# class RecipeException(Exception):
# class RetryableError(ForensicateError):
# 
# Path: auto_forensicate/uploader.py
# class BaseUploader(object):
# class LocalCopier(BaseUploader):
# class GCSUploader(BaseUploader):
#   def __init__(self, stamp_manager, stamp=None):
#   def _UploadStamp(self):
#   def _MakeRemotePath(self, destination):
#   def _UploadStream(self, stream, remote_path, update_callback=None):
#   def UploadArtifact(self, artifact, update_callback=None):
#   def __init__(self, destination_dir, stamp_manager, stamp=None):
#   def _UploadStream(self, stream, remote_path, update_callback=None):
#   def _MakeRemotePath(self, destination):
#   def __init__(self, gs_url, gs_keyfile, client_id, stamp_manager, stamp=None):
#   def _InitBoto(self):
#   def _SplitGCSUrl(self):
#   def _MakeRemotePath(self, destination):
#   def _UploadStream(self, stream, remote_path, update_callback=None):
# 
# 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: tests/auto_forensicate_tests.py
import argparse
import logging
import os
import sys
import tempfile
import unittest
import mock
from six import StringIO
from auto_forensicate import auto_acquire
from auto_forensicate import errors
from auto_forensicate import uploader
from auto_forensicate.recipes import base

        'test1': None,
        'test2': None
    }
    test_args = ['--acquire', 'test1', 'nfs://destination']
    af = auto_acquire.AutoForensicate(recipes=recipes)
    parser = af._CreateParser()
    options = parser.parse_args(test_args)
    expected_recipes = ['test1']
    self.assertEqual(options.acquire, expected_recipes)

  def testParseAcquireBad(self):
    recipes = {
        'test1': None,
        'test2': None
    }
    af = auto_acquire.AutoForensicate(recipes=recipes)
    test_args = [
        '--acquire', 'test4', '--acquire', 'all',
        '--gs_keyfile=file', 'gs://bucket']
    prev_stderr = sys.stderr
    sys.stderr = StringIO()
    with self.assertRaises(SystemExit):
      af.ParseArguments(test_args)
    sys.stderr = prev_stderr

  def testParseAcquireAll(self):
    recipes = {
        'test1': None,
        'test2': None
    }

    af = auto_acquire.AutoForensicate(recipes=recipes)