OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # -*- coding: utf-8 -*- | 2 # -*- coding: utf-8 -*- |
3 """Tests the engine.""" | 3 """Tests the engine.""" |
4 | 4 |
5 import unittest | 5 import unittest |
6 | 6 |
7 try: | 7 try: |
8 from guppy import hpy | 8 from guppy import hpy |
9 except ImportError: | 9 except ImportError: |
10 hpy = None | 10 hpy = None |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 """ | 59 """ |
60 self._file_system.Open(self._mount_point) | 60 self._file_system.Open(self._mount_point) |
61 return self._file_system, self._mount_point | 61 return self._file_system, self._mount_point |
62 | 62 |
63 | 63 |
64 class BaseEngineTest(shared_test_lib.BaseTestCase): | 64 class BaseEngineTest(shared_test_lib.BaseTestCase): |
65 """Tests for the engine object.""" | 65 """Tests for the engine object.""" |
66 | 66 |
67 # pylint: disable=protected-access | 67 # pylint: disable=protected-access |
68 | 68 |
| 69 # TODO: add tests for _GuessOS |
| 70 # TODO: add tests for CreateSession |
| 71 |
69 @shared_test_lib.skipUnlessHasTestFile([u'ímynd.dd']) | 72 @shared_test_lib.skipUnlessHasTestFile([u'ímynd.dd']) |
70 def testGetSourceFileSystem(self): | 73 def testGetSourceFileSystem(self): |
71 """Tests the GetSourceFileSystem function.""" | 74 """Tests the GetSourceFileSystem function.""" |
72 test_engine = engine.BaseEngine() | 75 test_engine = engine.BaseEngine() |
73 | 76 |
74 source_path = self._GetTestFilePath([u'ímynd.dd']) | 77 source_path = self._GetTestFilePath([u'ímynd.dd']) |
75 os_path_spec = path_spec_factory.Factory.NewPathSpec( | 78 os_path_spec = path_spec_factory.Factory.NewPathSpec( |
76 dfvfs_definitions.TYPE_INDICATOR_OS, location=source_path) | 79 dfvfs_definitions.TYPE_INDICATOR_OS, location=source_path) |
77 source_path_spec = path_spec_factory.Factory.NewPathSpec( | 80 source_path_spec = path_spec_factory.Factory.NewPathSpec( |
78 dfvfs_definitions.TYPE_INDICATOR_TSK, location=u'/', | 81 dfvfs_definitions.TYPE_INDICATOR_TSK, location=u'/', |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 """Tests the SupportsGuppyMemoryProfiling function.""" | 115 """Tests the SupportsGuppyMemoryProfiling function.""" |
113 test_engine = engine.BaseEngine() | 116 test_engine = engine.BaseEngine() |
114 | 117 |
115 expected_result = hpy is not None | 118 expected_result = hpy is not None |
116 result = test_engine.SupportsGuppyMemoryProfiling() | 119 result = test_engine.SupportsGuppyMemoryProfiling() |
117 self.assertEqual(result, expected_result) | 120 self.assertEqual(result, expected_result) |
118 | 121 |
119 | 122 |
120 if __name__ == '__main__': | 123 if __name__ == '__main__': |
121 unittest.main() | 124 unittest.main() |
OLD | NEW |