decisionengine.framework.dataspace.datasources.tests package
Submodules
decisionengine.framework.dataspace.datasources.tests.fixtures module
pytest fixtures/constants
- decisionengine.framework.dataspace.datasources.tests.fixtures.PG_DE_DB_WITHOUT_SCHEMA(request: FixtureRequest) Iterator[Connection]
Fixture factory for PostgreSQL.
- Parameters:
request – fixture request object
- Returns:
postgresql client
- decisionengine.framework.dataspace.datasources.tests.fixtures.PG_PROG(request: FixtureRequest, tmp_path_factory: TempPathFactory) Iterator[PostgreSQLExecutor]
Process fixture for PostgreSQL.
- Parameters:
request – fixture request object
tmp_path_factory – temporary path object (fixture)
- Returns:
tcp executor
- decisionengine.framework.dataspace.datasources.tests.fixtures.SQLALCHEMY_PG_WITH_SCHEMA(PG_DE_DB_WITHOUT_SCHEMA)[source]
Get a blank database from pytest_postgresql. Then setup the SQLAlchemy style URL with that DB. The SQLAlchemyDS will create the schema as needed.
- decisionengine.framework.dataspace.datasources.tests.fixtures.SQLALCHEMY_TEMPFILE_SQLITE(tmp_path)[source]
Setup an SQLite database with the pytest tmp_path fixture. Then setup the SQLAlchemy style URL with that DB. The SQLAlchemyDS will create the schema as needed.
- decisionengine.framework.dataspace.datasources.tests.fixtures.datasource(request)[source]
This parameterized fixture will setup up various datasources.
Add datasource objects to DATASOURCES_TO_TEST once they’ve got our basic schema loaded. And adjust our if statements here until we are SQLAlchemy only.
Pytest should take it from there and automatically run it through all the tests using this fixture.
- decisionengine.framework.dataspace.datasources.tests.fixtures.mock_data_block()[source]
This fixture replaces the standard datablock implementation.
The current DataBlock implementation does not own any data products but forwards them immediately to a backend datasource. The only implemented datasource requires Postgres, which is overkill when needing to test simple data-product communication between modules.
This mock datablock class directly owns the data products, thus avoiding the need for a datasource backend. It is anticipated that a future design of the DataBlock will own the data products, thus making this mock class unnecessary.
decisionengine.framework.dataspace.datasources.tests.test_datasource_api module
This test plan covers a generic dataspace object via pytest parameters.
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_create_tables(datasource)[source]
create_tables() should be safe to call multiple times
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_delete_data_older_than_arg(datasource)[source]
Can we delete old entries
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_duplicate_datablock(datasource)[source]
Can we duplicate taskmanager1 and all its entries
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_datablock(datasource)[source]
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_dataproduct(datasource)[source]
Can we get the dataproduct by uuid with key
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_dataproduct_not_exist(datasource)[source]
Does it error out if we ask for bogus information?
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_dataproducts(datasource)[source]
Can we get the dataproducts by uuid and uuid with key
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_dataproducts_not_exist(datasource)[source]
Does it error out if we ask for bogus information?
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_header(datasource)[source]
Can we fetch a header?
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_header_not_exist(datasource)[source]
Does it error out if we ask for a bogus header?
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_last_generation_id(datasource)[source]
Can we get the last generation id by name or name and uuid
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_last_generation_id_not_exist(datasource)[source]
Does it error out if we ask for a bogus taskmanager?
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_metadata(datasource)[source]
Can we fetch a metadata element?
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_metadata_not_exist(datasource)[source]
Does it error out if we ask for a bogus metadata element?
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_taskmanager_exists(datasource)[source]
Can I get a taskmanager by name or name and uuid
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_taskmanager_not_exists(datasource)[source]
This should error out
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_taskmanagers(datasource)[source]
Can I get multimple task managers
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_get_taskmanagers_not_exist(datasource)[source]
Do I error out when asking for garbage
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_has_config(datasource)[source]
This should have a config dict we can pass to jsonnet
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_insert(datasource)[source]
Can we insert new elements
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_reset_connections(datasource)[source]
reset_connections() should be safe to call any time
- decisionengine.framework.dataspace.datasources.tests.test_datasource_api.test_store_taskmanager(datasource)[source]
Can we make new entries