This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes unfoldingWord/door43.org#436 Double underscores in the `__handle` method were the main problem. Also made `Handler` an Abstract Base Class, and `_handle` and abstract method.
- Loading branch information
1 parent
b86fcec
commit dffd284
Showing
11 changed files
with
50 additions
and
11 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
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,36 @@ | ||
from __future__ import unicode_literals, print_function | ||
from unittest import TestCase | ||
from mock import patch | ||
from lambda_handlers.handler import Handler | ||
|
||
|
||
class MockHandler(Handler): | ||
|
||
def _handle(self, event, context): | ||
""" | ||
Test if this method is called | ||
:param event: | ||
:param context: | ||
:return: | ||
""" | ||
pass | ||
|
||
|
||
class TestHandler(TestCase): | ||
|
||
def test_inheritance(self): | ||
""" | ||
This tests if the inheritance from Handler is working correctly | ||
:return: None | ||
""" | ||
|
||
event = {'key1': 'value1'} | ||
context = {'key2': 'value2'} | ||
|
||
handler = MockHandler() | ||
|
||
# noinspection PyUnresolvedReferences | ||
with patch.object(handler, '_handle') as mock: | ||
handler.handle(event, context) | ||
|
||
mock.assert_called_with(event, context) |