def main(): args_parser = argparse.ArgumentParser(description="Tests get_version.") options = args_parser.parse_args() try: pyvhdi.get_version() except Exception: return False return True
def main(): args_parser = argparse.ArgumentParser( description="Tests get_version.") options = args_parser.parse_args() try: pyvhdi.get_version() except Exception: return False return True
def test_get_version(self): """Tests the get_version function.""" version = pyvhdi.get_version() self.assertIsNotNone(version)
import pyvmdk import pyvhdi print pyvmdk.get_version() print pyvhdi.get_version()
# -*- coding: utf-8 -*- """The VHD image file-like object.""" import pyvhdi from dfvfs.file_io import file_object_io from dfvfs.lib import errors from dfvfs.resolver import resolver if pyvhdi.get_version() < '20131210': raise ImportWarning('VhdiFile requires at least pyvhdi 20131210.') class VhdiFile(file_object_io.FileObjectIO): """Class that implements a file-like object using pyvhdi.""" def _OpenFileObject(self, path_spec): """Opens the file-like object defined by path specification. Args: path_spec: the path specification (instance of path.PathSpec). Returns: A file-like object. Raises: PathSpecError: if the path specification is incorrect. """ if not path_spec.HasParent(): raise errors.PathSpecError(
def test_get_version(self): """Tests the get_version function.""" version = pyvhdi.get_version()