<commit_before>import json
import requests

from tests.sample_data import BRAZIL_USER_POLY


def test_brazil_biomes():
    host = 'https://staging-api.globalforestwatch.org'
    url = '{}/v1/polyIntersect/brazil-biomes?'.format(host)
    url = 'http://localhost:5700/api/v1/polyIntersect/brazil-biomes'

    feats1 = json.loads(BRAZIL_USER_POLY)

    payload = {}
    payload['user_json'] = json.dumps(feats1)
    payload['category'] = 'name'

    result = requests.post(url, data=payload)
    result_obj = result.json()

    assert 'intersect-area' in list(result_obj.keys())
    assert 'intersect-area-percent' in list(result_obj.keys())

if __name__ == '__main__':
    test_brazil_biomes()
<commit_msg>changes to functional.py for testing<commit_after>import json
import requests

from sample_data import BRAZIL_USER_POLY


def test_brazil_biomes():
    host = 'https://staging-api.globalforestwatch.org'
    url = '{}/v1/polyIntersect/brazil-biomes?'.format(host)
    url = 'http://localhost:5700/api/v1/polyIntersect/brazil-biomes'
    # url = 'http://localhost:9000/v1/polyIntersect/brazil-biomes'

    feats1 = json.loads(BRAZIL_USER_POLY)

    payload = {}
    payload['user_json'] = json.dumps(feats1)
    payload['category'] = 'name'

    result = requests.post(url, data=payload)
    result_obj = result.json()

    print(result_obj)

    assert 'intersect-area' in list(result_obj.keys())
    assert 'intersect-area-percent' in list(result_obj.keys())

if __name__ == '__main__':
    test_brazil_biomes()

{'fraction_non_alphanumeric': 0.13711272247857614, 'fraction_numerical': 0.013843111404087014, 'mean_word_length': 4.180887372013652, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6570631', 'n_tokens_mistral': 565, 'n_tokens_neox': 547, 'n_words': 87}