move plugins from from ccsdk to dcaegen2
[dcaegen2/platform/plugins.git] / sshkeyshare / tests / test_plugin.py
1 import sshkeyshare.keyshare_plugin
2 from cloudify.mocks import MockCloudifyContext
3 from cloudify.state import current_ctx
4 from cloudify import ctx
5
6 def test_generate():
7   mock_ctx = MockCloudifyContext(node_id='test_node_id', node_name='test_node_name', properties={})
8   try:
9     current_ctx.set(mock_ctx)
10     sshkeyshare.keyshare_plugin.generate()
11     pub = ctx.instance.runtime_properties['public']
12     pvt64 = ctx.instance.runtime_properties['base64private']
13   finally:
14     current_ctx.clear()