-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
35 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
...aries/dagster-components/dagster_components_tests/unit_tests/test_registered_component.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
from dagster_components import Component, component_type | ||
from dagster_components.core.component import get_component_name, is_registered_component | ||
from dagster_components.core.component import get_component_type_name, is_registered_component_type | ||
|
||
|
||
def test_registered_component_with_default_name() -> None: | ||
@component_type | ||
class RegisteredComponent(Component): ... | ||
|
||
assert is_registered_component(RegisteredComponent) | ||
assert get_component_name(RegisteredComponent) == "registered_component" | ||
assert is_registered_component_type(RegisteredComponent) | ||
assert get_component_type_name(RegisteredComponent) == "registered_component" | ||
|
||
|
||
def test_registered_component_with_default_name_and_parens() -> None: | ||
@component_type() | ||
class RegisteredComponent(Component): ... | ||
|
||
assert is_registered_component(RegisteredComponent) | ||
assert get_component_name(RegisteredComponent) == "registered_component" | ||
assert is_registered_component_type(RegisteredComponent) | ||
assert get_component_type_name(RegisteredComponent) == "registered_component" | ||
|
||
|
||
def test_registered_component_with_explicit_kwarg_name() -> None: | ||
@component_type(name="explicit_name") | ||
class RegisteredComponent(Component): ... | ||
|
||
assert is_registered_component(RegisteredComponent) | ||
assert get_component_name(RegisteredComponent) == "explicit_name" | ||
assert is_registered_component_type(RegisteredComponent) | ||
assert get_component_type_name(RegisteredComponent) == "explicit_name" | ||
|
||
|
||
def test_unregistered_component() -> None: | ||
class UnregisteredComponent(Component): ... | ||
|
||
assert not is_registered_component(UnregisteredComponent) | ||
assert not is_registered_component_type(UnregisteredComponent) |