-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
1d963ef
commit 92fa064
Showing
7 changed files
with
28 additions
and
27 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
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
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,14 +1,14 @@ | ||
import pytest | ||
|
||
from opsml.cards import Card | ||
from opsml.cards import ArtifactCard | ||
from opsml.helpers.utils import validate_name_repository_pattern | ||
from opsml.types import CardInfo, Comment, RegistryType | ||
|
||
card_info = CardInfo(name="test", repository="opsml", contact="[email protected]") | ||
|
||
|
||
def test_artifact_card_with_args() -> None: | ||
card = Card( | ||
card = ArtifactCard( | ||
name=card_info.name, | ||
repository=card_info.repository, | ||
contact=card_info.contact, | ||
|
@@ -20,14 +20,14 @@ def test_artifact_card_with_args() -> None: | |
|
||
|
||
def test_artifact_card_without_args() -> None: | ||
card = Card(info=card_info) | ||
card = ArtifactCard(info=card_info) | ||
assert card.name == card_info.name | ||
assert card.repository == card_info.repository | ||
assert card.contact == card_info.contact | ||
|
||
|
||
def test_artifact_card_with_both() -> None: | ||
card = Card(name="override_name", info=card_info) | ||
card = ArtifactCard(name="override_name", info=card_info) | ||
|
||
assert card.name == "override-name" # string cleaning | ||
assert card.repository == card_info.repository | ||
|
@@ -42,7 +42,7 @@ def test_artifact_card_name_repository_fail() -> None: | |
) | ||
|
||
with pytest.raises(ValueError): | ||
Card( | ||
ArtifactCard( | ||
name=card_info.name, | ||
repository=card_info.repository, | ||
contact=card_info.contact, | ||
|
@@ -76,17 +76,17 @@ def test_argument_fail() -> None: | |
) | ||
|
||
with pytest.raises(ValueError): | ||
Card( | ||
ArtifactCard( | ||
repository=card_info.repository, | ||
contact=card_info.contact, | ||
) | ||
|
||
with pytest.raises(ValueError): | ||
Card( | ||
ArtifactCard( | ||
repository=card_info.repository, | ||
) | ||
|
||
with pytest.raises(ValueError): | ||
Card( | ||
ArtifactCard( | ||
info=card_info, | ||
) |