<commit_before># import Data as Import
# import Cloud
import pytest
import json
import flask
import numpy as np

#app = Flask(__name__)

def test_json_input():

    r = {"array": [1,2,3]}
    json_r = json.dumps({"array": [1,2,3]})

    python_json_r = json.loads(json_r)

    assert python_json_r == r


def test_sec_conversion():
    SEC_TO_MIN = 60
    avg_period_in_minutes = .25

    r = {"array": 15}


    #
    # json_r = json.dumps({"array": 15})
    #
    # python_json_r = json.loads(json_r)

    python_json_r = json.JSONDecoder().decode(r)

    v_array = np.array(python_json_r['array'])

    v_array = v_array / SEC_TO_MIN

    assert v_array == avg_period_in_minutes<commit_msg>Updated unit tests to check validity of json input after conversion as well as the averaging period from seconds to minutes.<commit_after># import Data as Import
# import Cloud
import pytest
import json
import numpy as np

#app = Flask(__name__)

def test_json_input():
    python_list = [1, 2, 3]
    json_input = json.dumps({"array": [1,2,3]})

    python_object = json.loads(json_input)

    assert python_list == python_object['array']


def test_sec_conversion():
    SEC_TO_MIN = 60

    python_avg_period = np.array([.25])

    json_input = json.dumps({"averaging_period": [15]})
    json_input = json.loads(json_input)
    print(json_input)
    print(type(json_input))
    json_input_value = np.array(json_input['averaging_period'])/SEC_TO_MIN

    assert json_input_value == python_avg_period


    #
    # python_object = json.loads(json_input)
    #
    # #
    # # json_r = json.dumps({"array": 15})
    # #
    # # python_json_r = json.loads(json_r)
    #
    # python_json_r = json.JSONDecoder().decode({"array": 15})
    #
    # v_array = np.array(python_json_r['array'])
    #
    # v_array = v_array / SEC_TO_MIN
    #
    # assert v_array == avg_period_in_minutes
{'fraction_non_alphanumeric': 0.12433297758804696, 'fraction_numerical': 0.016008537886873, 'mean_word_length': 3.4749403341288785, 'pattern_counts': {'":': 8, '<': 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': '3339301', 'n_tokens_mistral': 709, 'n_tokens_neox': 671, 'n_words': 142}