mirror of
https://github.com/dlt-hub/dlt.git
synced 2025-12-17 19:31:30 +00:00
* adds hub extra * makes hub module more user friendly when hub not installed * test and lint fixes * adds plugin version check util function * adds dlt-runtime to hub extra, minimal import tests * bumps to dlthub 0.20.0 alpha * lists pipelines with cli using the same functions as dashboard, dlt pipeline will list pipelines by default * adds configured propfiles method on context so only profiles with configs or pipelines are listed * adds list of locations that contained actual configs to provider interface * improves workspace and profile commands * test fixes * fixes tests
37 lines
906 B
Python
37 lines
906 B
Python
import pytest
|
|
from pytest_console_scripts import ScriptRunner
|
|
|
|
from tests.workspace.utils import isolated_workspace
|
|
|
|
|
|
def test_import_props() -> None:
|
|
import dlt.hub
|
|
|
|
# hub plugin found
|
|
assert dlt.hub.__found__
|
|
assert len(dlt.hub.__all__) > 0
|
|
|
|
# no exception
|
|
assert dlt.hub.__exception__ is None
|
|
|
|
# regular attribute error raised
|
|
|
|
with pytest.raises(AttributeError) as attr_err:
|
|
dlt.hub._unknown_feature
|
|
|
|
assert "_unknown_feature" in str(attr_err.value)
|
|
|
|
|
|
def test_runtime_client_imports(script_runner: ScriptRunner) -> None:
|
|
pytest.importorskip("dlt_runtime")
|
|
|
|
import dlt_runtime # type: ignore[import-untyped,import-not-found,unused-ignore]
|
|
|
|
print(dlt_runtime.__version__)
|
|
|
|
# check command activation
|
|
|
|
with isolated_workspace("pipelines"):
|
|
result = script_runner.run(["dlt", "runtime", "-h"])
|
|
assert result.returncode == 0
|