-
-
Notifications
You must be signed in to change notification settings - Fork 540
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix JavaScript error caused by new
ui.notify
(#3457)
* fix `ui.notify` * fix user tests involving notifications * reset ui.notify during teardown
- Loading branch information
1 parent
277ada6
commit fca2b55
Showing
5 changed files
with
29 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from typing import Any, List | ||
|
||
|
||
class UserNotify: | ||
|
||
def __init__(self) -> None: | ||
self.messages: List[str] = [] | ||
|
||
def __call__(self, message: str, **kwargs) -> None: | ||
self.messages.append(message) | ||
|
||
def contains(self, needle: Any) -> bool: | ||
"""Check if any of the messages contain the given substring.""" | ||
return isinstance(needle, str) and any(needle in message for message in self.messages) |