def test_get_agent_resource_local_path(self): properties = { 'cloudify_agent': { 'disable_requiretty': False, 'distro': 'Ubuntu', 'distro_codename': 'trusty' } } ctx = get_remote_context(properties) agent_package_path = tasks.get_agent_resource_local_path( ctx, ctx.node.properties['cloudify_agent'], 'agent_package_path') self.assertEquals(agent_package_path, '/Ubuntu-agent.tar.gz')
def test_get_agent_resource_path_from_agent_config(self): properties = { 'cloudify_agent': { 'user': '******', 'host': VAGRANT_MACHINE_IP, 'key': '~/.vagrant.d/insecure_private_key', 'port': 2222, 'distro': 'Ubuntu', 'distro_codename': 'trusty', 'agent_package_path': 'some-agent.tar.gz' } } ctx = get_remote_context(properties) path = properties['cloudify_agent']['agent_package_path'] r = tasks.get_agent_resource_local_path( ctx, ctx.node.properties['cloudify_agent'], 'agent_package_path') self.assertEquals(path, r)