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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 source_path_spec = path_spec_factory.Factory.NewPathSpec( | 102 source_path_spec = path_spec_factory.Factory.NewPathSpec( |
103 dfvfs_definitions.TYPE_INDICATOR_FAKE, location=u'/') | 103 dfvfs_definitions.TYPE_INDICATOR_FAKE, location=u'/') |
104 | 104 |
105 test_engine.PreprocessSources([source_path_spec]) | 105 test_engine.PreprocessSources([source_path_spec]) |
106 | 106 |
107 self.assertEqual(test_engine.knowledge_base.platform, u'Windows') | 107 self.assertEqual(test_engine.knowledge_base.platform, u'Windows') |
108 | 108 |
109 test_engine.PreprocessSources([None]) | 109 test_engine.PreprocessSources([None]) |
110 | 110 |
111 def testSupportsMemoryProfiling(self): | 111 def testSupportsGuppyMemoryProfiling(self): |
112 """Tests the SupportsMemoryProfiling function.""" | 112 """Tests the SupportsGuppyMemoryProfiling function.""" |
113 test_engine = engine.BaseEngine() | 113 test_engine = engine.BaseEngine() |
114 | 114 |
115 expected_result = hpy is not None | 115 expected_result = hpy is not None |
116 result = test_engine.SupportsMemoryProfiling() | 116 result = test_engine.SupportsGuppyMemoryProfiling() |
117 self.assertEqual(result, expected_result) | 117 self.assertEqual(result, expected_result) |
118 | 118 |
119 | 119 |
120 if __name__ == '__main__': | 120 if __name__ == '__main__': |
121 unittest.main() | 121 unittest.main() |
OLD | NEW |