Example #1
0
    def setUp(self):
        """Sets up the needed objects used throughout the test."""
        self._resolver_context = context.Context()
        test_file = self._GetTestFilePath(['syslog.base32'])
        self._SkipIfPathNotExists(test_file)

        self._os_path_spec = os_path_spec.OSPathSpec(location=test_file)
        self._encoded_stream_path_spec = (
            encoded_stream_path_spec.EncodedStreamPathSpec(
                encoding_method=definitions.ENCODING_METHOD_BASE32,
                parent=self._os_path_spec))
Example #2
0
    def testComparable(self):
        """Tests the path specification comparable property."""
        path_spec = encoded_stream_path_spec.EncodedStreamPathSpec(
            encoding_method=u'test', parent=self._path_spec)

        self.assertIsNotNone(path_spec)

        expected_comparable = u'\n'.join([
            u'type: TEST', u'type: ENCODED_STREAM, encoding_method: test', u''
        ])

        self.assertEqual(path_spec.comparable, expected_comparable)
    def setUp(self):
        """Sets up the needed objects used throughout the test."""
        self._resolver_context = context.Context()
        test_file = self._GetTestFilePath(['syslog.base64'])
        path_spec = os_path_spec.OSPathSpec(location=test_file)
        self._encoded_stream_path_spec = (
            encoded_stream_path_spec.EncodedStreamPathSpec(
                encoding_method=definitions.ENCODING_METHOD_BASE64,
                parent=path_spec))

        self._file_system = (
            encoded_stream_file_system.EncodedStreamFileSystem(
                self._resolver_context))
        self._file_system.Open(self._encoded_stream_path_spec)