-
Notifications
You must be signed in to change notification settings - Fork 6
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
0e50582
commit bf275fe
Showing
2 changed files
with
36 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from cantok import AbstractToken | ||
from cantok.errors import impossibleException | ||
|
||
|
||
class DefaultToken(AbstractToken): | ||
exception = impossibleException | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
def superpower(self) -> bool: | ||
return False | ||
|
||
def text_representation_of_superpower(self) -> str: | ||
return '' | ||
|
||
def get_superpower_exception_message(self) -> str: | ||
return 'This exception should not be raised.' # pragma: no cover | ||
|
||
@property | ||
def cancelled(self) -> bool: | ||
return False | ||
|
||
@cancelled.setter | ||
def cancelled(self, new_value: bool) -> None: | ||
if new_value == True: | ||
raise ValueError('You cannot cancel a default token.') | ||
|
||
def keep_on(self) -> bool: | ||
return True | ||
|
||
def is_cancelled(self, direct: bool = True) -> bool: | ||
return False |