Esempio n. 1
0
def test_check_account_keys_no_keys():
    """Test check_account_keys with no keys available."""
    config_file = data_path + os.sep + 'nokeys.cfg'
    config = utils.get_config(config_file)
    command_args = Turncoat()
    command_args.accessKey = None
    command_args.secretKey = None
    command_args.accountName = 'tester'

    with pytest.raises(EC2AccountException):
        utils.check_account_keys(config, command_args)
Esempio n. 2
0
def test_check_account_keys_no_cmd_keys():
    """Test check_account_keys with the keys available in the config file"""
    config_file = data_path + os.sep + 'complete.cfg'
    config = utils.get_config(config_file)
    command_args = Turncoat()
    command_args.accessKey = None
    command_args.secretKey = None
    command_args.accountName = 'tester'
    assert 1 == utils.check_account_keys(config, command_args)
Esempio n. 3
0
def test_check_account_keys_cmd_keys():
    """Test check_account_keys with the access and secret key on the
       command line."""
    config_file = data_path + os.sep + 'nokeys.cfg'
    config = utils.get_config(config_file)
    command_args = Turncoat()
    command_args.accessKey = 'AAAAAA'
    command_args.secretKey = 'BBBBBBB'
    command_args.accountName = 'tester'
    assert 1 == utils.check_account_keys(config, command_args)