<commit_before>#!/usr/bin/env python3

""" Docstring """

__author__ = '<NAME>'
__email__ = "<EMAIL>"

__copyright__ = "2014 Susan Sim"
__license__ = "MIT License"

__status__ = "Prototype"

# imports one per line
from mining import *

#Test if the function "six_best_months" and "six_worth_months" return the correct list.
def test_goog():
    read_stock_data("GOOG", "data/GOOG.json")
    assert six_best_months() == [('2007/12', 693.76), ('2007/11', 676.55), ('2007/10', 637.38), ('2008/01', 599.42),
                                 ('2008/05', 576.29), ('2008/06', 555.34)]
    assert six_worst_months() == [('2004/09', 116.38), ('2004/10', 164.52), ('2004/11', 177.09), ('2004/12', 181.01),
                                  ('2005/03', 181.18), ('2005/01', 192.96)]

#Test if the function insertitem() inserts the item into dictionary properly.
def test_insertitem():
    dic = {}
    assert insertitem("2007/12",100,100,dic) == {"2007/12":(100,100)}

test_goog()
test_insertitem()
<commit_msg>Test Cases<commit_after>#!/usr/bin/env python3

""" Docstring """

__author__ = '<NAME>'
__email__ = "<EMAIL>"

__copyright__ = "2014 Susan Sim"
__license__ = "MIT License"

__status__ = "Prototype"

# imports one per line
from mining import *

#Test if the function "six_best_months" and "six_worth_months" return the correct list.
def test_goog():
    read_stock_data("GOOG", "data/GOOG.json")
    assert six_best_months() == [('2007/12', 693.76), ('2007/11', 676.55), ('2007/10', 637.38), ('2008/01', 599.42),
                                 ('2008/05', 576.29), ('2008/06', 555.34)]
    assert six_worst_months() == [('2004/09', 116.38), ('2004/10', 164.52), ('2004/11', 177.09), ('2004/12', 181.01),
                                  ('2005/03', 181.18), ('2005/01', 192.96)]

#Test if the function insertitem() inserts the item into dictionary properly.
def test_insertitem():
    dic = {}
    assert insertitem("2007/12",100,100,dic) == {"2007/12":(100,100)}

test_goog()
# AssertionError Occurs when testing the six_worst_months,  the tuple ('2004/08', 104.66) displayed in the test instead of ('2005/01', 192.96)
test_insertitem()

{'fraction_non_alphanumeric': 0.18674136321195145, 'fraction_numerical': 0.16059757236227826, 'mean_word_length': 3.464583333333333, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1403651', 'n_tokens_mistral': 994, 'n_tokens_neox': 741, 'n_words': 189}