Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(236)

Unified Diff: tests/engine/engine.py

Issue 150170043: [plaso] Made preprocessing artifact driven #155 (Closed)
Patch Set: Changes after review Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/engine/engine.py
diff --git a/tests/engine/engine.py b/tests/engine/engine.py
index 9f1c6f0bf62c5ee4c9252c6d7077963e83aa8a08..749659c4a022cd203e9cb48f5beb2e8d47660f42 100644
--- a/tests/engine/engine.py
+++ b/tests/engine/engine.py
@@ -9,6 +9,8 @@ try:
except ImportError:
hpy = None
+from artifacts import reader as artifacts_reader
+from artifacts import registry as artifacts_registry
from dfvfs.helpers import fake_file_system_builder
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.path import factory as path_spec_factory
@@ -96,20 +98,26 @@ class BaseEngineTest(shared_test_lib.BaseTestCase):
with self.assertRaises(RuntimeError):
test_engine.GetSourceFileSystem(None)
+ @shared_test_lib.skipUnlessHasTestFile([u'artifacts'])
@shared_test_lib.skipUnlessHasTestFile([u'SOFTWARE'])
@shared_test_lib.skipUnlessHasTestFile([u'SYSTEM'])
def testPreprocessSources(self):
"""Tests the PreprocessSources function."""
+ registry = artifacts_registry.ArtifactDefinitionsRegistry()
+ reader = artifacts_reader.YamlArtifactsReader()
+ path = shared_test_lib.GetTestFilePath([u'artifacts'])
+ registry.ReadFromDirectory(reader, path)
+
test_engine = TestEngine()
source_path_spec = path_spec_factory.Factory.NewPathSpec(
dfvfs_definitions.TYPE_INDICATOR_FAKE, location=u'/')
- test_engine.PreprocessSources([source_path_spec])
+ test_engine.PreprocessSources(registry, [source_path_spec])
self.assertEqual(test_engine.knowledge_base.platform, u'Windows')
- test_engine.PreprocessSources([None])
+ test_engine.PreprocessSources(registry, [None])
def testSupportsGuppyMemoryProfiling(self):
"""Tests the SupportsGuppyMemoryProfiling function."""

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b