<commit_before>#![cfg(feature = "dynamodb")]

extern crate rusoto_core;
extern crate rusoto_dynamodb;

use rusoto_dynamodb::{DynamoDb, DynamoDbClient, ListTablesInput, ListTablesError};
use rusoto_core::{DefaultCredentialsProvider, Region};
use rusoto_core::default_tls_client;

#[test]
fn should_parse_error_type() {
    let credentials = DefaultCredentialsProvider::new().unwrap();
    let a_region = Region::Custom("http://localhost:8000".to_owned());
    let client = DynamoDbClient::new(default_tls_client().unwrap(), credentials, a_region);

    // limit of -1 should generate a validation error
    let request = ListTablesInput { limit: Some(-1), ..Default::default() };

    let response = client.list_tables(&request);
    match response {
        Err(ListTablesError::Validation(msg)) => {
            // local dynamodb gives a different error, this matches both:
            assert!(msg.contains("greater than or equal to 1"))
        }
        _ => panic!("Should have been a Validation error"),
    };
}

#[test]
fn should_list_tables() {
    let credentials = DefaultCredentialsProvider::new().unwrap();
    let a_region = Region::Custom("http://localhost:8000".to_owned());
    let client = DynamoDbClient::new(default_tls_client().unwrap(), credentials, a_region);
    let request = ListTablesInput::default();

    client.list_tables(&request).unwrap();
}<commit_msg>Reset dynamodb integration tests to use AWS.<commit_after>#![cfg(feature = "dynamodb")]

extern crate rusoto_core;
extern crate rusoto_dynamodb;

use rusoto_dynamodb::{DynamoDb, DynamoDbClient, ListTablesInput, ListTablesError};
use rusoto_core::{DefaultCredentialsProvider, Region};
use rusoto_core::default_tls_client;

#[test]
fn should_parse_error_type() {
    let credentials = DefaultCredentialsProvider::new().unwrap();
    let client = DynamoDbClient::new(default_tls_client().unwrap(), credentials, Region::UsEast1);

    // limit of -1 should generate a validation error
    let request = ListTablesInput { limit: Some(-1), ..Default::default() };

    let response = client.list_tables(&request);
    match response {
        Err(ListTablesError::Validation(msg)) => {
            // local dynamodb gives a different error, this matches both:
            assert!(msg.contains("greater than or equal to 1"))
        }
        _ => panic!("Should have been a Validation error"),
    };
}

#[test]
fn should_list_tables() {
    let credentials = DefaultCredentialsProvider::new().unwrap();
    let client = DynamoDbClient::new(default_tls_client().unwrap(), credentials, Region::UsEast1);
    let request = ListTablesInput::default();

    client.list_tables(&request).unwrap();
}
{'fraction_non_alphanumeric': 0.1328095772540217, 'fraction_numerical': 0.005985783763561541, 'mean_word_length': 4.641350210970464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4314324', 'n_tokens_mistral': 775, 'n_tokens_neox': 770, 'n_words': 182}