def test_init_specific(self, get_region, get_credentials, ec2_node_driver): os.environ['IMAGE_NAME'] = 'Fedora' ssh = SSHCrossCloud(**self.command_arg) ssh.ssh_params.aws.region = None get_credentials.return_value = "test1", "test2" ssh.spe_driver = get_provider_specific_driver(ssh.ssh_params) assert ssh.spe_driver.init_specific() is not None assert ssh.ssh_params.instance_user == "fedora" get_region.assert_called() get_credentials.assert_called() ec2_node_driver.assert_called()
def test_get_credentials(self, config_parser, is_file): is_file.return_value = True ssh = SSHCrossCloud(**self.command_arg) ssh.spe_driver = get_provider_specific_driver(ssh.ssh_params) assert len(ssh.spe_driver.get_credentials()) is 4 config_parser.assert_called()
def test_get_region(self, config_parser, is_file): is_file.return_value = True ssh = SSHCrossCloud(**self.command_arg) ssh.spe_driver = get_provider_specific_driver(ssh.ssh_params) assert ssh.spe_driver.get_region_from_config_file() is not None config_parser.assert_called()