-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved assertions for the "Is" syntax to a specific module so they can…
… be dynamically added to the Is class
- Loading branch information
Showing
35 changed files
with
847 additions
and
624 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .check import Check | ||
from .classes import Check | ||
from .is_cls import Is |
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,4 +1,4 @@ | ||
from ..check import Check | ||
from ..classes import Check | ||
from ..exceptions import CheckError | ||
|
||
|
||
|
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,4 +1,4 @@ | ||
from ..check import Check | ||
from ..classes import Check | ||
from ..exceptions import CheckError | ||
|
||
|
||
|
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,4 +1,4 @@ | ||
from ..check import Check | ||
from ..classes import Check | ||
from ..exceptions import CheckError | ||
from uuid import UUID | ||
|
||
|
Empty file.
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,74 @@ | ||
from ..is_cls import Is | ||
from ..classes import Check | ||
|
||
|
||
def boolean(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_boolean() | ||
return check_obj | ||
|
||
|
||
def not_boolean(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_boolean() | ||
return check_obj | ||
|
||
|
||
def true(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_true() | ||
return check_obj | ||
|
||
|
||
def false(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_false() | ||
return check_obj | ||
|
||
|
||
def not_true(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_true() | ||
return check_obj | ||
|
||
|
||
def not_false(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_false() | ||
return check_obj | ||
|
||
|
||
def falsy(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_falsy() | ||
return check_obj | ||
|
||
|
||
def not_falsy(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_falsy() | ||
return check_obj | ||
|
||
|
||
def truthy(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_truthy() | ||
return check_obj | ||
|
||
|
||
def not_truthy(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_truthy() | ||
return check_obj | ||
|
||
|
||
def has_same_truth_of(check_obj, compare_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).has_same_truth_of(compare_obj) | ||
return check_obj | ||
|
||
|
||
def has_opposite_truth_of(check_obj, compare_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).has_opposite_truth_of(compare_obj) | ||
return check_obj |
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,51 @@ | ||
from ..is_cls import Is | ||
from ..classes import Check | ||
from typing import Any, Set | ||
|
||
|
||
def set(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_set() | ||
return check_obj | ||
|
||
|
||
def not_set(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_set() | ||
return check_obj | ||
|
||
|
||
def subset_of(check_obj, full_set: Set[Any]) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_subset_of(full_set) | ||
return check_obj | ||
|
||
|
||
def not_subset_of(check_obj, full_set: Set[Any]) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_subset_of(full_set) | ||
return check_obj | ||
|
||
|
||
def superset_of(check_obj, full_set: Set[Any]) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_superset_of(full_set) | ||
return check_obj | ||
|
||
|
||
def not_superset_of(check_obj, subset: Set[Any]) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_superset_of(subset) | ||
return check_obj | ||
|
||
|
||
def intersects(check_obj, other_set: Set[Any]) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).intersects(other_set) | ||
return check_obj | ||
|
||
|
||
def not_intersects(check_obj, other_set: Set[Any]) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).not_intersects(other_set) | ||
return check_obj |
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,26 @@ | ||
from ..is_cls import Is | ||
from ..classes import Check | ||
|
||
|
||
def dict(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_dict() | ||
return check_obj | ||
|
||
|
||
def not_dict(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_dict() | ||
return check_obj | ||
|
||
|
||
def has_keys(check_obj, *keys) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).has_keys(*keys) | ||
return check_obj | ||
|
||
|
||
def has_not_keys(check_obj, *keys) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).has_not_keys(*keys) | ||
return check_obj |
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,26 @@ | ||
from ..is_cls import Is | ||
from ..classes import Check | ||
|
||
|
||
def latitude(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_latitude() | ||
return check_obj | ||
|
||
|
||
def longitude(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_longitude() | ||
return check_obj | ||
|
||
|
||
def azimuth(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_azimuth() | ||
return check_obj | ||
|
||
|
||
def geopoint(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_geopoint() | ||
return check_obj |
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,122 @@ | ||
from ..is_cls import Is | ||
from ..classes import Check | ||
|
||
|
||
def number(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_number() | ||
return check_obj | ||
|
||
|
||
def not_number(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_number() | ||
return check_obj | ||
|
||
|
||
def integer(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_integer() | ||
return check_obj | ||
|
||
|
||
def not_integer(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_integer() | ||
return check_obj | ||
|
||
|
||
def float(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_float() | ||
return check_obj | ||
|
||
|
||
def not_float(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_float() | ||
return check_obj | ||
|
||
|
||
def real(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_real() | ||
return check_obj | ||
|
||
|
||
def not_real(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_real() | ||
return check_obj | ||
|
||
|
||
def complex(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_complex() | ||
return check_obj | ||
|
||
|
||
def not_complex(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_complex() | ||
return check_obj | ||
|
||
|
||
def positive(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_positive() | ||
return check_obj | ||
|
||
|
||
def not_positive(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_positive() | ||
return check_obj | ||
|
||
|
||
def negative(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_negative() | ||
return check_obj | ||
|
||
|
||
def not_negative(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_negative() | ||
return check_obj | ||
|
||
|
||
def zero(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_zero() | ||
return check_obj | ||
|
||
|
||
def nonzero(check_obj) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_zero() | ||
return check_obj | ||
|
||
|
||
def at_least(check_obj, number) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_at_least(number) | ||
return check_obj | ||
|
||
|
||
def at_most(check_obj, number) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_at_most(number) | ||
return check_obj | ||
|
||
|
||
def between(check_obj, lower_bound, upper_bound) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_between(lower_bound, upper_bound) | ||
return check_obj | ||
|
||
|
||
def not_between(check_obj, lower_bound, upper_bound) -> "Is": | ||
# noinspection PyUnresolvedReferences | ||
Check(check_obj.object).is_not_between(lower_bound, upper_bound) | ||
return check_obj |
Oops, something went wrong.