forked from aws-cloudformation/cloudformation-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Hooks (aws-cloudformation#861)
* Added support for Hooks * Bump version to 0.2.23 * Removed unused unsupported target hook contract test * Update src/rpdk/core/data/schema/provider.configuration.definition.schema.hooks.v1.json Co-authored-by: Ben Bridts <[email protected]> * Update src/rpdk/core/data/schema/provider.configuration.definition.schema.hooks.v1.json Co-authored-by: Ben Bridts <[email protected]> Co-authored-by: Ben Bridts <[email protected]>
- Loading branch information
Showing
56 changed files
with
5,653 additions
and
301 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import logging | ||
|
||
__version__ = "0.2.22" | ||
__version__ = "0.2.23" | ||
|
||
logging.getLogger(__name__).addHandler(logging.NullHandler()) |
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,10 +1,37 @@ | ||
import pytest | ||
|
||
from rpdk.core.contract.hook_client import HookClient | ||
|
||
from .resource_client import ResourceClient | ||
|
||
|
||
class ContractPlugin: | ||
def __init__(self, resource_client): | ||
self._resource_client = resource_client | ||
def __init__(self, plugin_clients): | ||
if not plugin_clients: | ||
raise RuntimeError("No plugin clients are set up") | ||
|
||
self._plugin_clients = plugin_clients | ||
|
||
@pytest.fixture(scope="module") | ||
def resource_client(self): | ||
return self._resource_client | ||
try: | ||
resource_client = self._plugin_clients["resource_client"] | ||
except KeyError: | ||
resource_client = None | ||
|
||
if not isinstance(resource_client, ResourceClient): | ||
raise ValueError("Contract plugin client not setup for RESOURCE type") | ||
|
||
return resource_client | ||
|
||
@pytest.fixture(scope="module") | ||
def hook_client(self): | ||
try: | ||
hook_client = self._plugin_clients["hook_client"] | ||
except KeyError: | ||
hook_client = None | ||
|
||
if not isinstance(hook_client, HookClient): | ||
raise ValueError("Contract plugin client not setup for HOOK type") | ||
|
||
return hook_client |
Oops, something went wrong.