summaryrefslogtreecommitdiffstats
path: root/sshkeyshare/tests/test_plugin.py
blob: 6c5fe93853166db238ae779458b9a5f6da363528 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import sshkeyshare.keyshare_plugin
from cloudify.mocks import MockCloudifyContext
from cloudify.state import current_ctx
from cloudify import ctx

def test_generate():
  mock_ctx = MockCloudifyContext(node_id='test_node_id', node_name='test_node_name', properties={})
  try:
    current_ctx.set(mock_ctx)
    sshkeyshare.keyshare_plugin.generate()
    pub = ctx.instance.runtime_properties['public']
    pvt64 = ctx.instance.runtime_properties['base64private']
  finally:
    current_ctx.clear()