tests.fake package¶
Submodules¶
tests.fake.fake_database_information module¶
Fake class for the Information for the SQLite Database
-
class
tests.fake.fake_database_information.FakeDatabaseInformation(tables: [], column_type: {<class 'str'>, <class 'type'>})[source]¶ Bases:
objectFake class representing the SQLite Query validator.
tests.fake.fake_explain_query_plan module¶
Fake class for the explain query plan.
-
class
tests.fake.fake_explain_query_plan.FakeExplainQueryPlan(is_read_only: bool = True, locked_tables: [] = [])[source]¶ Bases:
plasoscaffolder.dal.base_explain_query_plan.BaseExplainQueryPlanFake class representing the explain query plan.
tests.fake.fake_file_handler module¶
fake class to create files
-
class
tests.fake.fake_file_handler.FakeFileHandler[source]¶ Bases:
plasoscaffolder.common.base_file_handler.BaseFileHandlerThe fake of the file handler.
tests.fake.fake_mapping_helper module¶
fake for __helper methods for mapping
-
class
tests.fake.fake_mapping_helper.FakeMappingHelper(template_path: str)[source]¶ Bases:
plasoscaffolder.bll.mappings.base_mapping_helper.BaseMappingHelperFake for the mapping helper.
tests.fake.fake_sqlite_database_information module¶
Base for sql Query validators
-
class
tests.fake.fake_sqlite_database_information.FakeSQLiteDatabaseInformation(required_tables: [<class 'str'>])[source]¶ Bases:
plasoscaffolder.dal.base_database_information.BaseDatabaseInformationClass representing the fake SQLite Database validator
-
GetTableColumnsAndType(table: str, all_lowercase=False) → [<class 'str'>][source]¶ Getting Types for Column if there is are multiple tables
Parameters: - tables ([str]) – the name of the table
- column_model ([sql_query_column_model.SQLColumnModel]) – the column to find the type for
- query (str) – the SQL query
Returns: - the column model with the types,
or None if there was a prefix error and it could not be parsed
Return type:
-
tests.fake.fake_sqlite_plugin_helper module¶
Fake Module containing helper functions for the SQLite plugin
-
class
tests.fake.fake_sqlite_plugin_helper.FakeSQLitePluginHelper(plugin_exists=False, folder_exists=False, file_exists=False, valid_name=True, change_bool_after_every_call_plugin_exists=False, change_bool_after_every_call_folder_exists=False, change_bool_after_every_call_file_exists=False, change_bool_after_every_call_valid_name=False, distinct_columns=None, valid_row_name=True, change_bool_after_every_call_valid_row_name=False, change_bool_after_every_call_valid_comma_separated_string=False, valid_comma_separated_string=True, columns_and_timestamp_column=([], []), assumed_timestamps=[])[source]¶ Bases:
plasoscaffolder.bll.services.base_sqlite_plugin_helper.BaseSQLitePluginHelperFake for the SQLite plugin helper
-
FileExists(path: str) → bool[source]¶ will return true false true ... starting with the initial (against loops while testing)
-
FolderExists(path: str) → bool[source]¶ will return true false true ... starting with the initial (against loops while testing)
-
GetAssumedTimestamps(columns: [<module 'plasoscaffolder.model.sql_query_column_model' from '/home/docs/checkouts/readthedocs.org/user_builds/plasoscaffolder/checkouts/latest/src/plasoscaffolder/model/sql_query_column_model.py'>]) → [<class 'str'>][source]¶ Gets all columns assumed that they are timestamps
Parameters: columns ([sql_query_column_model]) – the columns from the query Returns: the names from the columns assumed they could be a timestamp Return type: [str]
-
GetColumnsAndTimestampColumn(columns: [<class 'plasoscaffolder.model.sql_query_column_model.SQLColumnModel'>], timestamps: [<class 'str'>], data: [<class 'str'>]) -> ([<class 'plasoscaffolder.model.sql_query_column_model_data.SQLColumnModelData'>], [<class 'plasoscaffolder.model.sql_query_column_model.SQLColumnModel'>])[source]¶ Splits the column list into a list of simple columns and a list for timestamp event columns and adds the data to the simple columns
Parameters: - columns ([sql_query_column_model_data.SQLColumnModelData]) – the columns from the SQL query
- timestamps ([str]) – the timestamp events
- data ([str]) – the data from the cursor
Returns: - ([sql_query_column_model_data.SQLColumnModelData],
[sql_query_column_model.SQLColumnModel): a tuple of columns, the first are the normal columns, the second are the timestamp events
-
GetDistinctColumnsFromSQLQueryData(queries: [<class 'plasoscaffolder.dal.sql_query_data.SQLQueryData'>]) → [<class 'str'>][source]¶ Get a distinct list of all attributes from multiple queries
Parameters: queries ([base_sql_query_execution.SQLQueryData]) – an array of multiple sql query data objects Returns: a distinct list of all attributes used in the query Return type: [str]
-
IsValidCommaSeparatedString(text: str) → bool[source]¶ will return true false true ... starting with the initial (against loops while testing)
-
IsValidPluginName(plugin_name: str) → bool[source]¶ will return true false true ... starting with the initial (against loops while testing)
-
IsValidRowName(row_name: str) → bool[source]¶ will return true false true ... starting with the initial (against loops while testing)
-
PluginExists(path: str, plugin_name: str, database_suffix: str, path_helper: plasoscaffolder.bll.services.base_sqlite_plugin_path_helper.BaseSQLitePluginPathHelper) → bool[source]¶
-
RunSQLQuery(query: str, executor: <plasoscaffolder.dal.base_sql_query_execution.BaseSQLQueryExecution object at 0x7fccfef3fb38>)[source]¶ Validates the sql Query
Parameters: - executor (base_sql_query_execution.SQLQueryExection()) –
- query (str) – the sql Query
Returns: the data to the executed Query
Return type: base_sql_query_execution.SQLQueryData
-
tests.fake.fake_sqlite_plugin_path_helper module¶
Fake module containing helper functions for the SQLite plugin
-
class
tests.fake.fake_sqlite_plugin_path_helper.FakeSQLitePluginPathHelper(unused_path: str, plugin_name: str, unused_database_suffix: str)[source]¶ Bases:
plasoscaffolder.bll.services.base_sqlite_plugin_path_helper.BaseSQLitePluginPathHelperfake for the sqlite plugin path helper
tests.fake.fake_sqlite_query_execution module¶
Base for SQL query validators
-
class
tests.fake.fake_sqlite_query_execution.SQLQueryExecution(to_return: plasoscaffolder.dal.sql_query_data.SQLQueryData)[source]¶ Bases:
plasoscaffolder.dal.base_sql_query_execution.BaseSQLQueryExecutionClass representing the SQLite Query validator
-
ExecuteQuery(query: str) → plasoscaffolder.dal.sql_query_data.SQLQueryData[source]¶ Executes the SQL Query.
Parameters: query (str) – The SQL Query to execute on the SQLite database. Returns: The data to the Query Return type: sql_query_data.SQLQueryData
-
ExecuteQueryDetailed(query: str) → plasoscaffolder.dal.sql_query_data.SQLQueryData[source]¶ Executes the SQL Query and gets detailed information.
Parameters: query (str) – The SQL Query to execute on the SQLite database. Returns: The data to the Query Return type: sql_query_data.SQLQueryData
-
ExecuteReadOnlyQuery(query: str)[source]¶ Executes the SQL Query if it is read only, and valid to parse.
Parameters: query (str) – the SQL Query to execute on the SQLite database Returns: the data to the Query Return type: sql_query_data.SQLQueryData
-
tests.fake.fake_sqliteplugin_mapping module¶
fake formatter mapper
-
class
tests.fake.fake_sqliteplugin_mapping.FakeSQLitePluginMapper(mapping_helper: plasoscaffolder.bll.mappings.base_mapping_helper.BaseMappingHelper)[source]¶ Bases:
plasoscaffolder.bll.mappings.base_sqliteplugin_mapping.BaseSQLitePluginMapperclass representing the fake parser mapper