<commit_before>import application


app = application.app.test_client()
registry_url = 'http://thingstance.org/'
field_url = 'http://field.thingstance.org/'


def test_get_unknown_domain_404():
    response = app.get('/', base_url='http://no-such-domain.example.org')
    assert response.status_code == 404


def test_get_things():
    response = app.get('/', base_url=field_url)
    assert response.status_code == 200


def test_get_thing_404():
    hash = "aaaaaaaaa"
    response = app.get('/hash/%s' % hash, base_url=field_url)
    assert response.status_code == 404<commit_msg>A collection must exist for the test to be ok<commit_after>import application


app = application.app.test_client()
db = application.db
registry_url = 'http://thingstance.org/'
field_url = 'http://testing.thingstance.org/'


def test_get_unknown_domain_404():
    response = app.get('/', base_url='http://no-such-domain.example.org')
    assert response.status_code == 404


def test_get_things():
    collections = db.collection_names()
    if 'testing' not in collections:
        db.create_collection('testing')
    response = app.get('/', base_url=field_url)
    assert response.status_code == 200


def test_get_thing_404():
    hash = "aaaaaaaaa"
    response = app.get('/hash/%s' % hash, base_url=field_url)
    assert response.status_code == 404
{'fraction_non_alphanumeric': 0.13782771535580524, 'fraction_numerical': 0.02247191011235955, 'mean_word_length': 4.198443579766537, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '304337', 'n_tokens_mistral': 454, 'n_tokens_neox': 418, 'n_words': 88}