<commit_before>import sys
import hashlib

import data_holder
import writer

linux_hashes = {
"test_of_PythonSerializer" : "d77aba9af887b02875be83660dc02ae9",
"test_of_PythonSerializer_enum" : "26f524cefc1243e04e18bbee34eac884",
"test_of_PythonSerializer_import" : "42b158e97a9e205de2178d6befaeed35"
}

windows_hashes = {
"test_of_PythonSerializer" : "bce7e420fbdb878941e28bf38c69b5fc",
"test_of_PythonSerializer_enum" : "9cbdcca5ebf27b8b8bcb2b7f080bcf6f",
"test_of_PythonSerializer_import" : "e57c2d6db6b44ecdabba127dd0532aa0"
}

hashes = linux_hashes if sys.platform == "linux2" else windows_hashes

def test_of_PythonSerializer():

    ih = data_holder.IncludeHolder()
    th = data_holder.TypeDefHolder()

    for x in range(20, 400, 3):
        ih.add_to_list("test_include_"+str(x))
        th.add_to_list("td_elem_name_"+str(x), "td_elem_val_"+str(x))
        th.add_to_list("td_elem_name_"+str(x), "i_td_elem_val_"+str(x))
        th.add_to_list("td_elem_name_"+str(x), "u_td_elem_val_"+str(x))

    enum = data_holder.EnumHolder()
    for x in range(1, 200):
        enum.add_to_list("elem_" + str(x), "val_"+ str(x))

    dh = data_holder.DataHolder( include = ih, typedef = th )
    dh.enum_dict["test"] = enum


    ps = writer.PythonSerializer()
    o =  ps.serialize(dh)
    assert hashes["test_of_PythonSerializer"] == hashlib.md5( o ).hexdigest()<commit_msg>coverage of PythonSerializer<commit_after>import sys
import hashlib

import data_holder
import writer

linux_hashes = {
"test_of_PythonSerializer" : "0437fc1b78dd0bfd25d9c2ad69e44cb5",
"test_of_PythonSerializer_enum" : "26f524cefc1243e04e18bbee34eac884",
"test_of_PythonSerializer_import" : "42b158e97a9e205de2178d6befaeed35"
}

windows_hashes = {
"test_of_PythonSerializer" : "bce7e420fbdb878941e28bf38c69b5fc",
"test_of_PythonSerializer_enum" : "9cbdcca5ebf27b8b8bcb2b7f080bcf6f",
"test_of_PythonSerializer_import" : "e57c2d6db6b44ecdabba127dd0532aa0"
}

hashes = linux_hashes if sys.platform == "linux2" else windows_hashes

def test_of_PythonSerializer():

    ih = data_holder.IncludeHolder()
    th = data_holder.TypeDefHolder()

    for x in range(20, 400, 60):
        ih.add_to_list("test_include_"+str(x))
        th.add_to_list("td_elem_name_"+str(x), "td_elem_val_"+str(x))
        th.add_to_list("td_elem_name_"+str(x), "i_td_elem_val_"+str(x))
        th.add_to_list("td_elem_name_"+str(x), "u_td_elem_val_"+str(x))

    enum = data_holder.EnumHolder()
    for x in range(1, 200, 30):
        enum.add_to_list("elem_" + str(x), "val_"+ str(x))

    const = data_holder.ConstantHolder()
    const.add_to_list("C_A","5")
    const.add_to_list("C_B","5")
    const.add_to_list("C_C", "C_B + C_A")

    dh = data_holder.DataHolder( include = ih, typedef = th , constant = const)
    dh.enum_dict["test"] = enum

    

    ps = writer.PythonSerializer()
    o =  ps.serialize(dh)
    print o
    assert hashes["test_of_PythonSerializer"] == hashlib.md5( o ).hexdigest()
{'fraction_non_alphanumeric': 0.12605896306336836, 'fraction_numerical': 0.07624534056252118, 'mean_word_length': 5.362068965517241, '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': '4250078', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1188, 'n_words': 165}