-
Notifications
You must be signed in to change notification settings - Fork 3
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
Juan M Salamanca
authored
Sep 20, 2024
1 parent
a08129b
commit eac74c2
Showing
24 changed files
with
571 additions
and
245 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
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,5 +1,23 @@ | ||
""" | ||
Custom exceptions used in this package. | ||
Nada DSL Exceptions. | ||
""" | ||
class NadaNotAllowedException(Exception): | ||
pass | ||
|
||
|
||
class NotAllowedException(Exception): | ||
"""Exception for not allowed use cases.""" | ||
|
||
|
||
class InvalidTypeError(Exception): | ||
"""Invalid type error""" | ||
|
||
|
||
class MissingProgramArgumentError(Exception): | ||
"""Missing program argument""" | ||
|
||
|
||
class MissingEntryPointError(Exception): | ||
"""Missing nada_main entry point for the program.""" | ||
|
||
|
||
class IncompatibleTypesError(Exception): | ||
"""The types in an operation are not compatible.""" |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Tests for NadaType.""" | ||
|
||
import pytest | ||
from nada_dsl.nada_types import NadaType | ||
from nada_dsl.nada_types.scalar_types import Integer, PublicBoolean, SecretInteger | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("cls", "expected"), | ||
[ | ||
(SecretInteger, "SecretInteger"), | ||
(Integer, "Integer"), | ||
(PublicBoolean, "Boolean"), | ||
], | ||
) | ||
def test_class_to_type(cls: NadaType, expected: str): | ||
"""Tests `NadaType.class_to_type()""" | ||
assert cls.class_to_type() == expected |
Oops, something went wrong.