refact: move repository to data_repository

This commit is contained in:
2025-01-14 07:00:19 +01:00
parent bb691acc14
commit 1a49158afa
6 changed files with 20 additions and 20 deletions

View File

@@ -6,13 +6,13 @@ import pytest
from plesna.dataplatform import DataPlateform
from plesna.models.graphs import Edge, EdgeOnSet, Node
from plesna.models.flux import Flux, Transformation
from plesna.storage.repository.fs_repository import FSRepository
from plesna.storage.data_repository.fs_data_repository import FSDataRepository
FIXTURE_DIR = Path(__file__).parent.parent / Path("raw_datas")
@pytest.fixture
def repository(tmp_path) -> FSRepository:
def repository(tmp_path) -> FSDataRepository:
example_src = FIXTURE_DIR
assert example_src.exists()
@@ -24,11 +24,11 @@ def repository(tmp_path) -> FSRepository:
silver_path = Path(tmp_path) / "silver"
silver_path.mkdir()
return FSRepository("test", "test", tmp_path)
return FSDataRepository("test", "test", tmp_path)
def test_add_repository(
repository: FSRepository,
repository: FSDataRepository,
):
dp = DataPlateform()
dp.add_repository(repository)
@@ -39,7 +39,7 @@ def test_add_repository(
@pytest.fixture
def copy_flux(repository: FSRepository) -> Flux:
def copy_flux(repository: FSDataRepository) -> Flux:
raw_username = [repository.table("test-raw-username")]
bronze_username = [repository.table("test-bronze-username")]
@@ -62,7 +62,7 @@ def copy_flux(repository: FSRepository) -> Flux:
@pytest.fixture
def foo_flux(repository: FSRepository) -> Flux:
def foo_flux(repository: FSDataRepository) -> Flux:
src = [
repository.table("test-raw-username"),
repository.table("test-raw-recovery"),
@@ -84,7 +84,7 @@ def foo_flux(repository: FSRepository) -> Flux:
return flux
def test_add_flux(repository: FSRepository, copy_flux: Flux):
def test_add_flux(repository: FSDataRepository, copy_flux: Flux):
dataplatform = DataPlateform()
dataplatform.add_repository(repository)
@@ -99,7 +99,7 @@ def test_add_flux(repository: FSRepository, copy_flux: Flux):
@pytest.fixture
def dataplatform(
repository: FSRepository,
repository: FSDataRepository,
foo_flux: Flux,
copy_flux: Flux,
) -> DataPlateform:

View File

@@ -3,7 +3,7 @@ from pathlib import Path
import pytest
from plesna.storage.repository.fs_repository import FSRepository
from plesna.storage.data_repository.fs_data_repository import FSDataRepository
FIXTURE_DIR = Path(__file__).parent.parent / Path("./raw_datas/")
@@ -20,7 +20,7 @@ def location(tmp_path):
def test_init(location):
repo = FSRepository("example", "example", location)
repo = FSDataRepository("example", "example", location)
assert repo.ls() == [
"schema",
]
@@ -44,8 +44,8 @@ def test_init(location):
@pytest.fixture
def repository(location) -> FSRepository:
return FSRepository("repo_id", "example", location)
def repository(location) -> FSDataRepository:
return FSDataRepository("repo_id", "example", location)
def test_list_schemas(repository):