<commit_before>extern crate gooddata_fs;

use gooddata_fs::*;

fn connect() -> gd::GoodDataClient {
    let mut gd = gd::GoodDataClient::new(gooddata_fs::rest::url::SERVER.to_string(), None);
    gd.connect("<EMAIL>", "jindrisska");
    gd
}

#[test]
fn it_creates_client() {
    let gd = gd::GoodDataClient::new(gooddata_fs::rest::url::SERVER.to_string(), None);
    assert_eq!(gd.projects.is_some(), false);
    assert_eq!(gd.user.is_some(), false);
    assert_eq!(gd.token_updated.is_some(), false);
}

#[test]
fn client_can_connect() {
    let gd = connect();

    assert_eq!(gd.projects.is_some(), false);
    assert_eq!(gd.user.is_some(), true);
    assert_eq!(gd.token_updated.is_some(), true);
}

#[test]
fn client_can_disconnect() {
    let mut gd = connect();
    gd.disconnect();

    assert_eq!(gd.projects.is_some(), false);
    assert_eq!(gd.user.is_some(), false);
    assert_eq!(gd.token_updated.is_some(), false);
}

#[test]
fn client_can_get_projects() {
    let mut gd = connect();
    gd.projects_fetch();

    assert_eq!(gd.projects.is_some(), true);
    assert_eq!(gd.user.is_some(), true);
    assert_eq!(gd.token_updated.is_some(), true);

    gd.disconnect();
}
<commit_msg>Fixing tests<commit_after>extern crate gooddata_fs;

use gooddata_fs::*;

fn connect() -> gd::GoodDataClient {
    // Create instance of GoodData HTTP Connector
    let connector = gooddata_fs::gd::Connector::new(gooddata_fs::rest::url::SERVER.to_string());
    // Create instance of GoodData REST API Client
    let mut gd = gooddata_fs::gd::GoodDataClient::new(connector, None);
    gd.connect("<EMAIL>", "jindrisska");
    gd
}

#[test]
fn it_creates_connector() {
    // Create instance of GoodData HTTP Connector
    let connector = gooddata_fs::gd::Connector::new(gooddata_fs::rest::url::SERVER.to_string());
    assert_eq!(connector.token_updated.is_some(), false);
}

#[test]
fn it_creates_client() {
    // Create instance of GoodData HTTP Connector
    let connector = gooddata_fs::gd::Connector::new(gooddata_fs::rest::url::SERVER.to_string());
    // Create instance of GoodData REST API Client
    let gd = gd::GoodDataClient::new(connector, None);
    assert_eq!(gd.projects.is_some(), false);
    assert_eq!(gd.user.is_some(), false);
    assert_eq!(gd.token.is_some(), false);
}

#[test]
fn it_creates_client_with_token() {
    // Create instance of GoodData HTTP Connector
    let connector = gooddata_fs::gd::Connector::new(gooddata_fs::rest::url::SERVER.to_string());
    let token = Some("xxx".to_string());
    // Create instance of GoodData REST API Client
    let gd = gd::GoodDataClient::new(connector, token);
    assert_eq!(gd.token.is_some(), true);
    assert_eq!(gd.projects.is_some(), false);
    assert_eq!(gd.user.is_some(), false);
}

#[test]
fn client_can_connect() {
    let gd = connect();
    assert_eq!(gd.projects.is_some(), false);
    assert_eq!(gd.user.is_some(), true);

}

#[test]
fn client_can_disconnect() {
    let mut gd = connect();
    gd.disconnect();
    assert_eq!(gd.projects.is_some(), false);
    assert_eq!(gd.user.is_some(), false);
}

#[test]
fn client_can_get_projects() {
    let mut gd = connect();
    gd.projects_fetch();
    assert_eq!(gd.projects.is_some(), true);
    assert_eq!(gd.user.is_some(), true);
    gd.disconnect();
}

{'fraction_non_alphanumeric': 0.1703096539162113, 'fraction_numerical': 0.0, 'mean_word_length': 4.53781512605042, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2164723', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1156, 'n_words': 213}