<commit_before>"""
High-level REST API unit tests.

Todo: Look at http://packages.python.org/Flask-Testing/
"""


from StringIO import StringIO
import json
import tempfile
import time

from nose.tools import *
import vcf

from varda import create_app, db
from varda.models import User


TEST_SETTINGS = {
    'TESTING': True,
    'FILES_DIR': tempfile.mkdtemp(),
    'SQLALCHEMY_DATABASE_URI': 'sqlite://',
    'BROKER_TRANSPORT': 'memory',
    'CELERY_RESULT_BACKEND': 'database',
    'CELERY_RESULT_DBURI': 'sqlite://',
    'CELERY_ALWAYS_EAGER': True,
    # Note: If exceptions are propagated, on_failure handlers are not called.
    'CELERY_EAGER_PROPAGATES_EXCEPTIONS': True
}


def auth_header(login='admin', password='<PASSWORD>'):<commit_msg>Better unit test configuration settings<commit_after>"""
High-level REST API unit tests.

Todo: Look at http://packages.python.org/Flask-Testing/
"""


from StringIO import StringIO
import json
import tempfile
import time

from nose.tools import *
import vcf

from varda import create_app, db
from varda.models import User


TEST_SETTINGS = {
    'TESTING': True,
    'FILES_DIR': tempfile.mkdtemp(),
    'SQLALCHEMY_DATABASE_URI': 'sqlite://',
    'BROKER_URL': 'memory://',
    'CELERY_RESULT_BACKEND': 'cache',
    'CELERY_CACHE_BACKEND': 'memory',
    'CELERY_ALWAYS_EAGER': True,
    # Note: If exceptions are propagated, on_failure handlers are not called.
    'CELERY_EAGER_PROPAGATES_EXCEPTIONS': True
}


def auth_header(login='admin', password='<PASSWORD>'):
{'fraction_non_alphanumeric': 0.11989459815546773, 'fraction_numerical': 0.0, 'mean_word_length': 4.689138576779026, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1257439', 'n_tokens_mistral': 547, 'n_tokens_neox': 517, 'n_words': 131}