-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
5872f9b
commit ef47f46
Showing
11 changed files
with
427 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- coding: utf-8 -*- | ||
"""The Virtual File System (VFS) extent.""" | ||
|
||
|
||
class Extent(object): | ||
"""Extent. | ||
Attributes: | ||
extent_type (str): type of the extent, for example EXTENT_TYPE_SPARSE. | ||
offset (int): offset of the extent relative from the start of the file | ||
system in bytes. | ||
size (int): size of the extent in bytes. | ||
""" | ||
|
||
def __init__(self, extent_type=None, offset=None, size=None): | ||
"""Initializes an extent. | ||
Args: | ||
extent_type (Optional[str]): type of the extent, for example | ||
EXTENT_TYPE_SPARSE. | ||
offset (Optional[int]): offset of the extent relative from the start of | ||
the file system in bytes. | ||
size (Optional{int]): size of the extent in bytes. | ||
""" | ||
super(Extent, self).__init__() | ||
self.extent_type = extent_type | ||
self.offset = offset | ||
self.size = size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the VFS extent.""" | ||
|
||
import unittest | ||
|
||
from dfvfs.vfs import extent | ||
|
||
from tests import test_lib as shared_test_lib | ||
|
||
|
||
class ExtentTest(shared_test_lib.BaseTestCase): | ||
"""Tests the VFS extent.""" | ||
|
||
def testInitialize(self): | ||
"""Test the __init__ function.""" | ||
test_extent = extent.Extent() | ||
self.assertIsNotNone(test_extent) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.