# Path: l2tscaffolder/lib/errors.py
# class Error(Exception):
# class EngineNotConfigured(Error):
# class FileHandlingError(Error):
# class NoValidDefinition(Error):
# class ScaffolderNotConfigured(Error):
# class UnableToConfigure(Error):
# class WrongCliInput(Error):
# 
# Path: l2tscaffolder/scaffolders/plaso_sqlite.py
# class SQLQuestion(interface.DictQuestion):
# class PlasoSQLiteScaffolder(plaso.PlasoPluginScaffolder):
#   def ValidateAnswer(self, answer: dict):
#   def __init__(self):
#   def _GetQueryColumns(self, query: str) -> Iterator[str]:
#   def _GetSchema(self, database_path: str) -> Dict[str, str]:
#   def GetJinjaContext(self) -> Dict[str, object]:
#   def GenerateFiles(self) -> Iterator[Tuple[str, str]]:
#   NAME = 'sqlite'
#   DESCRIPTION = 'Provides a scaffolder to generate a plaso SQLite plugin.'
#   SCHEMA_QUERY = (
#       'SELECT tbl_name, sql '
#       'FROM sqlite_master '
#       'WHERE type = "table" AND tbl_name != "xp_proc" '
#       'AND tbl_name != "sqlite_sequence"')
#   TEMPLATE_PARSER_FILE = 'sqlite_plugin.jinja2'
#   TEMPLATE_PARSER_TEST = 'sqlite_plugin_test.jinja2'
#   TEMPLATE_FORMATTER_FILE = 'sqlite_plugin_formatter.jinja2'
#   TEMPLATE_FORMATTER_TEST = 'sqlite_plugin_formatter_test.jinja2'
#   QUESTIONS = [
#       SQLQuestion(
#           attribute='queries', prompt=(
#               'Define the name of the callback function (key) that will be\n'
#               'called for every row returned from the SQL query (value).\n'
#               'The plugin will execute the SQL query and call the callback\n'
#               'once for each resulting row. The name of the function should\n'
#               'follow style guide and be descriptive. An example of that is\n'
#               'a SQL statement that fetches bookmarks, the key name should be\n'
#               'Bookmark, or if the SQL statement collects GPS coordinates\n'
#               'it could be called Location.'),
#           key_prompt='Callback function name', value_prompt='SQL Statement'),
#       interface.ListQuestion(
#           attribute='required_tables', prompt='List of required tables')]


import unittest
from l2tscaffolder.lib import errors
from l2tscaffolder.scaffolders import plaso_sqlite
      scaffolder (plaso_sqlite.PlasoSQLiteScaffolder): scaffolder to test.
      test_string (str): string to test the _GetQueryColumns method on.
      expected_columns (set[str]): columns names expected to be extracted from
          the test string.
    """
    # pylint: disable=protected-access
    columns = set(list(scaffolder._GetQueryColumns(test_string)))
    self.assertEqual(columns, expected_columns)

  def testQueryColumns(self):
    """Test query columns function."""
    scaffolder = plaso_sqlite.PlasoSQLiteScaffolder()
    test_string = (
        'SELECT foobar as Foo, foobar.dot, random, reallylong AS long FROM '
        'foobarengine WHERE foobar = 1')
    expected_columns = set(['foo', 'dot', 'random', 'long'])
    self._RunQueryTests(scaffolder, test_string, expected_columns)

    test_string = (
        'select one, two as three, four as five, f.eight as EIGHTE FROM '
        'foobar f, scode s WHERE f.id = s.id ORDER BY one')
    expected_columns = set(['one', 'three', 'five', 'eighte'])
    self._RunQueryTests(scaffolder, test_string, expected_columns)

    test_string = (
        'this should not produce anything...')
    self._RunQueryTests(scaffolder, test_string, set())

  def testPlasoSQLiteScaffolder(self):
    """Test the plaso SQLite scaffolder."""

# Path: l2tscaffolder/lib/errors.py
# class Error(Exception):
# class EngineNotConfigured(Error):
# class FileHandlingError(Error):
# class NoValidDefinition(Error):
# class ScaffolderNotConfigured(Error):
# class UnableToConfigure(Error):
# class WrongCliInput(Error):
# 
# Path: l2tscaffolder/scaffolders/plaso_sqlite.py
# class SQLQuestion(interface.DictQuestion):
# class PlasoSQLiteScaffolder(plaso.PlasoPluginScaffolder):
#   def ValidateAnswer(self, answer: dict):
#   def __init__(self):
#   def _GetQueryColumns(self, query: str) -> Iterator[str]:
#   def _GetSchema(self, database_path: str) -> Dict[str, str]:
#   def GetJinjaContext(self) -> Dict[str, object]:
#   def GenerateFiles(self) -> Iterator[Tuple[str, str]]:
#   NAME = 'sqlite'
#   DESCRIPTION = 'Provides a scaffolder to generate a plaso SQLite plugin.'
#   SCHEMA_QUERY = (
#       'SELECT tbl_name, sql '
#       'FROM sqlite_master '
#       'WHERE type = "table" AND tbl_name != "xp_proc" '
#       'AND tbl_name != "sqlite_sequence"')
#   TEMPLATE_PARSER_FILE = 'sqlite_plugin.jinja2'
#   TEMPLATE_PARSER_TEST = 'sqlite_plugin_test.jinja2'
#   TEMPLATE_FORMATTER_FILE = 'sqlite_plugin_formatter.jinja2'
#   TEMPLATE_FORMATTER_TEST = 'sqlite_plugin_formatter_test.jinja2'
#   QUESTIONS = [
#       SQLQuestion(
#           attribute='queries', prompt=(
#               'Define the name of the callback function (key) that will be\n'
#               'called for every row returned from the SQL query (value).\n'
#               'The plugin will execute the SQL query and call the callback\n'
#               'once for each resulting row. The name of the function should\n'
#               'follow style guide and be descriptive. An example of that is\n'
#               'a SQL statement that fetches bookmarks, the key name should be\n'
#               'Bookmark, or if the SQL statement collects GPS coordinates\n'
#               'it could be called Location.'),
#           key_prompt='Callback function name', value_prompt='SQL Statement'),
#       interface.ListQuestion(
#           attribute='required_tables', prompt='List of required tables')]


# Path: tests/scaffolders/plaso_sqlite.py
import unittest
from l2tscaffolder.lib import errors
from l2tscaffolder.scaffolders import plaso_sqlite

      scaffolder (plaso_sqlite.PlasoSQLiteScaffolder): scaffolder to test.
      test_string (str): string to test the _GetQueryColumns method on.
      expected_columns (set[str]): columns names expected to be extracted from
          the test string.
    """
    # pylint: disable=protected-access
    columns = set(list(scaffolder._GetQueryColumns(test_string)))
    self.assertEqual(columns, expected_columns)

  def testQueryColumns(self):
    """Test query columns function."""
    scaffolder = plaso_sqlite.PlasoSQLiteScaffolder()
    test_string = (
        'SELECT foobar as Foo, foobar.dot, random, reallylong AS long FROM '
        'foobarengine WHERE foobar = 1')
    expected_columns = set(['foo', 'dot', 'random', 'long'])
    self._RunQueryTests(scaffolder, test_string, expected_columns)

    test_string = (
        'select one, two as three, four as five, f.eight as EIGHTE FROM '
        'foobar f, scode s WHERE f.id = s.id ORDER BY one')
    expected_columns = set(['one', 'three', 'five', 'eighte'])
    self._RunQueryTests(scaffolder, test_string, expected_columns)

    test_string = (
        'this should not produce anything...')
    self._RunQueryTests(scaffolder, test_string, set())

  def testPlasoSQLiteScaffolder(self):
    """Test the plaso SQLite scaffolder."""

    scaffolder = plaso_sqlite.PlasoSQLiteScaffolder()