feat: start datacatalogue
This commit is contained in:
43
tests/dataplatform/test_dataplateform.py
Normal file
43
tests/dataplatform/test_dataplateform.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from plesna.dataplatform import DataPlateform
|
||||
from plesna.datastore.fs_datacatalogue import FSDataCatalogue
|
||||
|
||||
FIXTURE_DIR = Path(__file__).parent / Path("raw_data")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def raw_catalogue(tmp_path):
|
||||
raw_path = Path(tmp_path) / "raw"
|
||||
raw_path.mkdir()
|
||||
return FSDataCatalogue("raw", raw_path)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def bronze_catalogue(tmp_path):
|
||||
bronze_path = Path(tmp_path) / "bronze"
|
||||
bronze_path.mkdir()
|
||||
return FSDataCatalogue("bronze", bronze_path)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def silver_catalogue(tmp_path):
|
||||
silver_path = Path(tmp_path) / "silver"
|
||||
silver_path.mkdir()
|
||||
return FSDataCatalogue("silver", silver_path)
|
||||
|
||||
|
||||
def test_add_catalogue(
|
||||
raw_catalogue: FSDataCatalogue,
|
||||
bronze_catalogue: FSDataCatalogue,
|
||||
silver_catalogue: FSDataCatalogue,
|
||||
):
|
||||
dp = DataPlateform()
|
||||
dp.add_datacatalague("raw", raw_catalogue)
|
||||
dp.add_datacatalague("bronze", bronze_catalogue)
|
||||
dp.add_datacatalague("silver", silver_catalogue)
|
||||
|
||||
assert dp.datacatalogues == ["raw", "bronze", "silver"]
|
||||
assert dp.get_datacatalogue("raw") == raw_catalogue
|
||||
BIN
tests/e2e/raw_data/salary.pdf
Normal file
BIN
tests/e2e/raw_data/salary.pdf
Normal file
Binary file not shown.
BIN
tests/e2e/raw_data/username-password-recovery-code.xls
Normal file
BIN
tests/e2e/raw_data/username-password-recovery-code.xls
Normal file
Binary file not shown.
BIN
tests/e2e/raw_data/username-password-recovery-code.xlsx
Normal file
BIN
tests/e2e/raw_data/username-password-recovery-code.xlsx
Normal file
Binary file not shown.
7
tests/e2e/raw_data/username.csv
Normal file
7
tests/e2e/raw_data/username.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
Username;Identifier;First name;Last name
|
||||
booker12;9012;Rachel;Booker
|
||||
grey07;2070;Laura;Grey
|
||||
johnson81;4081;Craig;Johnson
|
||||
jenkins46;9346;Mary;Jenkins
|
||||
smith79;5079;Jamie;Smith
|
||||
|
||||
|
39
tests/e2e/test_datalake.py
Normal file
39
tests/e2e/test_datalake.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from plesna.dataplatform import DataPlateform
|
||||
from plesna.datastore.fs_datacatalogue import FSDataCatalogue
|
||||
|
||||
FIXTURE_DIR = Path(__file__).parent / Path("raw_data")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def raw_catalogue(tmp_path):
|
||||
raw_path = Path(tmp_path) / "raw"
|
||||
return FSDataCatalogue(raw_path)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def bronze_catalogue(tmp_path):
|
||||
bronze_path = Path(tmp_path) / "bronze"
|
||||
return FSDataCatalogue(bronze_path)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def silver_catalogue(tmp_path):
|
||||
silver_path = Path(tmp_path) / "silver"
|
||||
return FSDataCatalogue(silver_path)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def dataplateform(
|
||||
raw_catalogue: FSDataCatalogue,
|
||||
bronze_catalogue: FSDataCatalogue,
|
||||
silver_catalogue: FSDataCatalogue,
|
||||
):
|
||||
dp = DataPlateform()
|
||||
dp.add_datacatalague("raw", raw_catalogue)
|
||||
dp.add_datacatalague("bronze", bronze_catalogue)
|
||||
dp.add_datacatalague("silver", silver_catalogue)
|
||||
pass
|
||||
Reference in New Issue
Block a user