def METHOD_NAME(make_stubber, error_code):
    secretsmanager_client = boto3.client('secretsmanager')
    secretsmanager_stubber = make_stubber(secretsmanager_client)
    secret = SecretsManagerSecret(secretsmanager_client)
    pw_length = 20
    password = 'test-password'
    secretsmanager_stubber.stub_get_random_password(
        pw_length, password, error_code=error_code)
    if error_code is None:
        got_password = secret.get_random_password(pw_length)
        assert got_password == password
    else:
        with pytest.raises(ClientError) as exc_info:
            secret.get_random_password(pw_length)
        assert exc_info.value.response['Error']['Code'] == error_code