-
Notifications
You must be signed in to change notification settings - Fork 2
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
632655c
commit 70e4726
Showing
19 changed files
with
96 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from .protocol import Protocol | ||
|
||
|
||
class DefaultProtocol(Protocol): | ||
name: str = "default" | ||
|
||
def debug(self, msg: str, *args, **kwargs): | ||
"""Nothing will be logged here""" | ||
pass | ||
|
||
def info(self, msg: str, *args, **kwargs): | ||
"""Nothing will be logged here""" | ||
pass | ||
|
||
def warning(self, msg: str, *args, **kwargs): | ||
"""Nothing will be logged here""" | ||
pass | ||
|
||
def error(self, msg: str, *args, **kwargs): | ||
"""Nothing will be logged here""" | ||
pass | ||
|
||
def respond(self, data: str): | ||
print(data) |
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,5 @@ | ||
import logging | ||
|
||
from .protocol import Protocol | ||
|
||
|
||
|
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,5 @@ | ||
from unittest.mock import Mock | ||
|
||
from slack_cli_hooks.protocol.protocol import Protocol | ||
|
||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from slack_cli_hooks.protocol import DefaultProtocol | ||
|
||
|
||
class TestDefaultProtocol: | ||
def test_name(self): | ||
assert DefaultProtocol.name == "default" | ||
|
||
def test_debug(self, capsys): | ||
DefaultProtocol().debug("test") | ||
|
||
out, err = capsys.readouterr() | ||
assert out == "" | ||
assert err == "" | ||
|
||
def test_info(self, capsys): | ||
DefaultProtocol().info("test") | ||
|
||
out, err = capsys.readouterr() | ||
assert out == "" | ||
assert err == "" | ||
|
||
def test_warning(self, capsys): | ||
DefaultProtocol().warning("test") | ||
|
||
out, err = capsys.readouterr() | ||
assert out == "" | ||
assert err == "" | ||
|
||
def test_error(self, capsys): | ||
DefaultProtocol().error("test") | ||
|
||
out, err = capsys.readouterr() | ||
assert out == "" | ||
assert err == "" | ||
|
||
def test_respond(self, capsys): | ||
DefaultProtocol().respond("test") | ||
|
||
out, err = capsys.readouterr() | ||
assert out == "test\n" | ||
assert err == "" |
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