# Path: dftimewolf/lib/state.py
# T = TypeVar("T", bound="interface.AttributeContainer")  # pylint: disable=invalid-name,line-too-long
# NEW_ISSUE_URL = 'https://github.com/log2timeline/dftimewolf/issues/new'
# class DFTimewolfState(object):
#   def __init__(self, config: Type[Config]) -> None:
#   def _InvokeModulesInThreads(self, callback: Callable[[Any], Any]) -> None:
#   def ImportRecipeModules(self, module_locations: Dict[str, str]) -> None:
#   def LoadRecipe(self,
#                  recipe: Dict[str, Any],
#                  module_locations: Dict[str, str]) -> None:
#   def FormatExecutionPlan(self) -> str:
#   def LogExecutionPlan(self) -> None:
#   def AddToCache(self, name: str, value: Any) -> None:
#   def GetFromCache(self, name: str, default_value: Any=None) -> Any:
#   def StoreContainer(self, container: "interface.AttributeContainer") -> None:
#   def GetContainers(self,
#                     container_class: Type[T],
#                     pop: bool=False) -> Sequence[T]:
#   def DedupeContainers(self, container_class: Type[T]) -> None:
#   def _SetupModuleThread(self, module_definition: Dict[str, str]) -> None:
#   def SetupModules(self) -> None:
#   def _RunModuleThread(self, module_definition: Dict[str, str]) -> None:
#   def RunPreflights(self) -> None:
#   def CleanUpPreflights(self) -> None:
#   def InstantiateModule(self, module_name: str) -> "dftw_module.BaseModule":
#   def RunModules(self) -> None:
#   def RegisterStreamingCallback(
#       self,
#       target: Callable[["interface.AttributeContainer"], Any],
#       container_type: Type["interface.AttributeContainer"]) -> None:
#   def StreamContainer(self, container: "interface.AttributeContainer") -> None:
#   def AddError(self, error: DFTimewolfError) -> None:
#   def CleanUp(self) -> None:
#   def CheckErrors(self, is_global: bool=False) -> None:
# 
# Path: dftimewolf/lib/collectors/virustotal.py
# class VTCollector(module.BaseModule):
#   def __init__(
#       self,
#       state: DFTimewolfState,
#       name: Optional[str],
#       critical: bool = False) -> None:
#   def Process(self) -> None:
#   def SetUp(
#       self,
#       hashes: str,
#       vt_api_key: str,
#       vt_type: str,
#       directory: str,
#   ) -> None:
#   def _downloadFile(self, download_link: str,
#                     filename: str) -> Union[BufferedWriter, None]:
#   def _createContainer(self, vt_hash: str, file: BufferedWriter) -> None:
#   def _CheckOutputPath(self, directory: str) -> str:
#   def _getDownloadLinks(self, vt_hash: str) -> List[str]:
# 
# Path: dftimewolf/config.py
# class Config(object):
#   def GetExtra(cls, name: str='') -> Dict[str, Any]:
#   def LoadExtra(cls, filename: str) -> bool:
#   def LoadExtraData(cls, json_string: bytes) -> None:
#   def ClearExtra(cls) -> None:


import unittest
from dftimewolf.lib import state
from dftimewolf.lib.collectors import virustotal
from dftimewolf import config
# -*- coding: utf-8 -*-
"""Tests the VirusTotal (VT) collector."""




FAKE_VT_API_KEY = '123456789'

FAKE_Hashes = 'e2a24ab94f865caeacdf2c3ad015f31f23008ac6db8312c2cbfb32e4a5466ea2'

FAKE_VT_TYPE_EVTX = 'evtx'

FAKE_VT_TYPE_PCAP = 'pcap'

FAKE_DIRECTORY = '/tmp/123'


class VTCollectingTest(unittest.TestCase):
  """Tests for the GCP logging collector."""

  def testInitialization(self):
    """Tests that the collector can be initialized."""
    test_state = state.DFTimewolfState(config.Config)
    vt_collector = virustotal.VTCollector(test_state, name='test')
    self.assertIsNotNone(vt_collector)

  def testSetUp2(self):
    """Tests that VTCollector methods are called with the correct
    args.
    """

# Path: dftimewolf/lib/state.py
# T = TypeVar("T", bound="interface.AttributeContainer")  # pylint: disable=invalid-name,line-too-long
# NEW_ISSUE_URL = 'https://github.com/log2timeline/dftimewolf/issues/new'
# class DFTimewolfState(object):
#   def __init__(self, config: Type[Config]) -> None:
#   def _InvokeModulesInThreads(self, callback: Callable[[Any], Any]) -> None:
#   def ImportRecipeModules(self, module_locations: Dict[str, str]) -> None:
#   def LoadRecipe(self,
#                  recipe: Dict[str, Any],
#                  module_locations: Dict[str, str]) -> None:
#   def FormatExecutionPlan(self) -> str:
#   def LogExecutionPlan(self) -> None:
#   def AddToCache(self, name: str, value: Any) -> None:
#   def GetFromCache(self, name: str, default_value: Any=None) -> Any:
#   def StoreContainer(self, container: "interface.AttributeContainer") -> None:
#   def GetContainers(self,
#                     container_class: Type[T],
#                     pop: bool=False) -> Sequence[T]:
#   def DedupeContainers(self, container_class: Type[T]) -> None:
#   def _SetupModuleThread(self, module_definition: Dict[str, str]) -> None:
#   def SetupModules(self) -> None:
#   def _RunModuleThread(self, module_definition: Dict[str, str]) -> None:
#   def RunPreflights(self) -> None:
#   def CleanUpPreflights(self) -> None:
#   def InstantiateModule(self, module_name: str) -> "dftw_module.BaseModule":
#   def RunModules(self) -> None:
#   def RegisterStreamingCallback(
#       self,
#       target: Callable[["interface.AttributeContainer"], Any],
#       container_type: Type["interface.AttributeContainer"]) -> None:
#   def StreamContainer(self, container: "interface.AttributeContainer") -> None:
#   def AddError(self, error: DFTimewolfError) -> None:
#   def CleanUp(self) -> None:
#   def CheckErrors(self, is_global: bool=False) -> None:
# 
# Path: dftimewolf/lib/collectors/virustotal.py
# class VTCollector(module.BaseModule):
#   def __init__(
#       self,
#       state: DFTimewolfState,
#       name: Optional[str],
#       critical: bool = False) -> None:
#   def Process(self) -> None:
#   def SetUp(
#       self,
#       hashes: str,
#       vt_api_key: str,
#       vt_type: str,
#       directory: str,
#   ) -> None:
#   def _downloadFile(self, download_link: str,
#                     filename: str) -> Union[BufferedWriter, None]:
#   def _createContainer(self, vt_hash: str, file: BufferedWriter) -> None:
#   def _CheckOutputPath(self, directory: str) -> str:
#   def _getDownloadLinks(self, vt_hash: str) -> List[str]:
# 
# Path: dftimewolf/config.py
# class Config(object):
#   def GetExtra(cls, name: str='') -> Dict[str, Any]:
#   def LoadExtra(cls, filename: str) -> bool:
#   def LoadExtraData(cls, json_string: bytes) -> None:
#   def ClearExtra(cls) -> None:


# Path: tests/lib/collectors/virustotal.py
import unittest
from dftimewolf.lib import state
from dftimewolf.lib.collectors import virustotal
from dftimewolf import config

# -*- coding: utf-8 -*-
"""Tests the VirusTotal (VT) collector."""




FAKE_VT_API_KEY = '123456789'

FAKE_Hashes = 'e2a24ab94f865caeacdf2c3ad015f31f23008ac6db8312c2cbfb32e4a5466ea2'

FAKE_VT_TYPE_EVTX = 'evtx'

FAKE_VT_TYPE_PCAP = 'pcap'

FAKE_DIRECTORY = '/tmp/123'


class VTCollectingTest(unittest.TestCase):
  """Tests for the GCP logging collector."""

  def testInitialization(self):
    """Tests that the collector can be initialized."""
    test_state = state.DFTimewolfState(config.Config)
    vt_collector = virustotal.VTCollector(test_state, name='test')
    self.assertIsNotNone(vt_collector)

  def testSetUp2(self):
    """Tests that VTCollector methods are called with the correct
    args.
    """

    test_state = state.DFTimewolfState(config.Config)