OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # -*- coding: utf-8 -*- | 2 # -*- coding: utf-8 -*- |
3 """Tests for the file entry implementation using pyvslvm.""" | 3 """Tests for the file entry implementation using pyvslvm.""" |
4 | 4 |
5 import unittest | 5 import unittest |
6 | 6 |
7 from dfvfs.path import lvm_path_spec | 7 from dfvfs.path import lvm_path_spec |
8 from dfvfs.path import os_path_spec | 8 from dfvfs.path import os_path_spec |
9 from dfvfs.path import qcow_path_spec | 9 from dfvfs.path import qcow_path_spec |
10 from dfvfs.resolver import context | 10 from dfvfs.resolver import context |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 # Offset: 0x00000000 (0) | 72 # Offset: 0x00000000 (0) |
73 # Size: 4.0 MiB (4194304 bytes) | 73 # Size: 4.0 MiB (4194304 bytes) |
74 # Number of stripes: 1 | 74 # Number of stripes: 1 |
75 # Stripe: 1 | 75 # Stripe: 1 |
76 # Physical volume: pv0 | 76 # Physical volume: pv0 |
77 # Data area offset: 0x00800000 (8388608) | 77 # Data area offset: 0x00800000 (8388608) |
78 | 78 |
79 def testIntialize(self): | 79 def testIntialize(self): |
80 """Test the __init__ function.""" | 80 """Test the __init__ function.""" |
81 file_entry = lvm_file_entry.LVMFileEntry( | 81 file_entry = lvm_file_entry.LVMFileEntry( |
82 self._resolver_context, self._file_system, self._lvm_path_spec) | 82 self._resolver_context, self._file_system, self._lvm_path_spec, |
| 83 is_virtual=True) |
83 | 84 |
84 self.assertIsNotNone(file_entry) | 85 self.assertIsNotNone(file_entry) |
85 | 86 |
86 def testGetParentFileEntry(self): | 87 def testGetParentFileEntry(self): |
87 """Tests the GetParentFileEntry function.""" | 88 """Tests the GetParentFileEntry function.""" |
88 path_spec = lvm_path_spec.LVMPathSpec( | 89 path_spec = lvm_path_spec.LVMPathSpec( |
89 parent=self._qcow_path_spec, volume_index=1) | 90 parent=self._qcow_path_spec, volume_index=1) |
90 file_entry = self._file_system.GetFileEntryByPathSpec(path_spec) | 91 file_entry = self._file_system.GetFileEntryByPathSpec(path_spec) |
91 self.assertIsNotNone(file_entry) | 92 self.assertIsNotNone(file_entry) |
92 | 93 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 data_stream = file_entry.GetDataStream(data_stream_name) | 212 data_stream = file_entry.GetDataStream(data_stream_name) |
212 self.assertIsNotNone(data_stream) | 213 self.assertIsNotNone(data_stream) |
213 self.assertEqual(data_stream.name, data_stream_name) | 214 self.assertEqual(data_stream.name, data_stream_name) |
214 | 215 |
215 data_stream = file_entry.GetDataStream(u'bogus') | 216 data_stream = file_entry.GetDataStream(u'bogus') |
216 self.assertIsNone(data_stream) | 217 self.assertIsNone(data_stream) |
217 | 218 |
218 | 219 |
219 if __name__ == '__main__': | 220 if __name__ == '__main__': |
220 unittest.main() | 221 unittest.main() |
OLD | NEW |