Skip to content

Commit

Permalink
chore: update tests to followsuite with api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma committed Jul 27, 2024
1 parent a513438 commit 1011bb7
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 16 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from cdf.injector import ConfigResolver
from cdf.core.configuration import ConfigResolver


def test_apply_converters():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typing as t

from cdf.injector import DependencyRegistry
from cdf.core.injector import DependencyRegistry


def test_registry():
Expand Down
27 changes: 14 additions & 13 deletions tests/nextgen/test_workspace.py → tests/core/test_workspace.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import cdf.injector as injector
import cdf.nextgen.model as model
from cdf.nextgen.workspace import Workspace
import cdf.core.component as cmp
import cdf.core.configuration as conf
import cdf.core.injector as injector
from cdf.core.workspace import Workspace


def test_workspace():
Expand All @@ -27,32 +28,32 @@ def test_resource():
},
*Workspace.configuration_sources,
],
service_definitons=[
model.Service(
service_definitions=[
cmp.Service(
"a",
injector.Dependency(1),
owner="Alex",
description="A secret number",
sla=model.ServiceLevelAgreement.CRITICAL,
sla=cmp.ServiceLevelAgreement.CRITICAL,
),
model.Service(
cmp.Service(
"b", injector.Dependency(lambda a: a + 1 * 5 / 10), owner="Alex"
),
model.Service(
cmp.Service(
"prod_bigquery", injector.Dependency("dwh-123"), owner="DataTeam"
),
model.Service(
cmp.Service(
"sfdc",
injector.Dependency(
injector.map_config_section("sfdc")(
conf.map_config_section("sfdc")(
lambda username: f"https://sfdc.com/{username}"
)
),
owner="RevOps",
),
],
source_definitons=[
model.Source(
source_definitions=[
cmp.Source(
"source_a",
injector.Dependency(test_source),
owner="Alex",
Expand All @@ -61,7 +62,7 @@ def test_resource():
],
)

@injector.map_config_values(secret_number="a.b.c")
@conf.map_config_values(secret_number="a.b.c")
def c(secret_number: int, sfdc: str) -> int:
print(f"SFDC: {sfdc=}")
return secret_number * 10
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import dlt
import pytest

from cdf.core.project import Project, load_project
from cdf.legacy.project import Project, load_project


def test_load_project():
Expand Down
File renamed without changes.

0 comments on commit 1011bb7

Please sign in to comment.