<commit_before>import json

from polyIntersect import app

app = app.test_client()

def test_hello():
    url = '/api/v1/polyIntersect/hello?'
    result = app.get(url)
    assert result.status_code == 200
<commit_msg>added basic test suite<commit_after>
from os import path

from polyIntersect import app

app = app.test_client()

fixtures = path.abspath(path.join(path.dirname(__file__), 'fixtures'))

with open(path.join(fixtures, 'maine.geojson')) as f:
    maine = "".join(f.read().split())

with open(path.join(fixtures, 'maine-geometry.geojson')) as f:
    maine_geom = "".join(f.read().split())

with open(path.join(fixtures, 'maine-featureset.geojson')) as f:
    maine_featureset = "".join(f.read().split())


def test_hello():
    url = '/api/v1/polyIntersect/hello?'
    result = app.get(url)
    assert result.status_code == 200


def test_poly_intersect_successful():
    url = '/api/v1/polyIntersect'

    payload = {}
    payload['user_poly'] = maine_featureset
    payload['intersect_polys'] = maine_featureset

    result = app.post(url, data=payload)
    assert result.status_code == 200


def test_geom_area():
    url = '/api/v1/polyIntersect/geom'
    payload = {}
    payload['user_poly'] = maine_featureset
    payload['intersect_polys'] = maine_featureset

    result = app.post(url, data=payload)
    assert result.status_code == 200

{'fraction_non_alphanumeric': 0.1426470588235294, 'fraction_numerical': 0.011764705882352941, 'mean_word_length': 4.0783582089552235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4965602', 'n_tokens_mistral': 488, 'n_tokens_neox': 470, 'n_words': 94}