<commit_before>#!/usr/bin/env bats
# /tests/util-fetch.bats
#
# Tests for the utility functions to fetch shell scripts in travis/
#
# See LICENCE.md for Copyright information

load polysquare_ci_scripts_helper
source "${POLYSQUARE_TRAVIS_SCRIPTS}/util.sh"

setup() {
    export server_dir=$(mktemp -d /tmp/psq-container.XXXXXX)
    mkdir -p "${server_dir}" > /dev/null 2>&1
    pushd "${server_dir}" > /dev/null 2>&1
    touch "fetch-local-test.sh"
    python -m "SimpleHTTPServer" 8080 > /dev/null 2>&1 &
    export __polysquare_fake_host_pid=$!
    popd > /dev/null 2>&1

    export POLYSQUARE_CI_SCRIPTS_DIR=$(mktemp -d /tmp/psq-container.XXXXXX)
    mkdir -p "${POLYSQUARE_CI_SCRIPTS_DIR}" > /dev/null 2>&1<commit_msg>Add a delay for SimpleHTTPServer startup.<commit_after>#!/usr/bin/env bats
# /tests/util-fetch.bats
#
# Tests for the utility functions to fetch shell scripts in travis/
#
# See LICENCE.md for Copyright information

load polysquare_ci_scripts_helper
source "${POLYSQUARE_TRAVIS_SCRIPTS}/util.sh"

setup() {
    export server_dir=$(mktemp -d /tmp/psq-container.XXXXXX)
    mkdir -p "${server_dir}" > /dev/null 2>&1
    pushd "${server_dir}" > /dev/null 2>&1
    touch "fetch-local-test.sh"
    python -m "SimpleHTTPServer" 8080 > /dev/null 2>&1 &
    sleep 1 # Allow SimpleHTTPServer to start up
    export __polysquare_fake_host_pid=$!
    popd > /dev/null 2>&1

    export POLYSQUARE_CI_SCRIPTS_DIR=$(mktemp -d /tmp/psq-container.XXXXXX)
    mkdir -p "${POLYSQUARE_CI_SCRIPTS_DIR}" > /dev/null 2>&1
{'fraction_non_alphanumeric': 0.1341222879684418, 'fraction_numerical': 0.0190664036817883, 'mean_word_length': 3.8938906752411575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '6113648', 'n_tokens_mistral': 597, 'n_tokens_neox': 565, 'n_words': 129}