# Path: lib/slack/analysis/network.py
# def message_number_graph(log_dict, nicks, nick_same_list, DAY_BY_DAY_ANALYSIS=False):
#     def msg_no_analysis_helper(rec_list, nick_sender, nick, conn_comp_list,conversations,today_conversation):
#     def message_no_add_egde(message_graph, conversation):
# def filter_edge_list(edgelist_file_loc, max_hash, how_many_top):
# def degree_analysis_on_graph(nx_graph, date=None):
#     def nodes_with_degree_populator(degree_values, label): 
#     def give_userlist_where_degree_helper(degree_dict, degree):
#     def raw_node_append(nodes, raw, degree_type):        
# def message_time_graph(log_dict, nicks, nick_same_list, DAY_BY_DAY_ANALYSIS=False):
#     def compare_spliced_nick(nick_to_compare, spliced_nick, nick_name, line):
# def message_number_bins_csv(log_dict, nicks, nick_same_list):
#     def bin_increment(nick_name, messager, nick_spliced, bins, bin_index):
# def degree_node_number_csv(log_dict, nicks, nick_same_list):
#     def format_degree_list(degree_list, max_range, degree_type):
# def nick_receiver_from_conn_comp(nick, conn_comp_list):
# def identify_hubs_and_experts(log_dict, nicks, nick_same_list):
#     G = util.to_graph(nick_same_list)
#     G = util.to_graph(nick_same_list)


import unittest
import os
import lib.slack.in_out.reader as reader
import lib.slack.nickTracker as nickTracker
from lib.slack.analysis import network


class DataSetTest(unittest.TestCase):

    def setUp(self):
        self.current_directory = os.path.dirname(os.path.realpath(__file__))
        self.log_data_dir = self.current_directory+"/data/input/slackware/"
        self.start_date = '2013-01-01'
        self.end_date  ='2013-01-08'
        self.expected_result = 137,1754

    def tearDown(self):
        self.current_directory = None
        self.log_data_dir = None
        self.start_date = None
        self.end_date = None
        self.expected_result = None

    def test_dataset(self):
        log_data = reader.linux_input_slack(self.log_data_dir, self.start_date, self.end_date)
        nicks, nick_same_list = nickTracker.nick_tracker(log_data)

# Path: lib/slack/analysis/network.py
# def message_number_graph(log_dict, nicks, nick_same_list, DAY_BY_DAY_ANALYSIS=False):
#     def msg_no_analysis_helper(rec_list, nick_sender, nick, conn_comp_list,conversations,today_conversation):
#     def message_no_add_egde(message_graph, conversation):
# def filter_edge_list(edgelist_file_loc, max_hash, how_many_top):
# def degree_analysis_on_graph(nx_graph, date=None):
#     def nodes_with_degree_populator(degree_values, label): 
#     def give_userlist_where_degree_helper(degree_dict, degree):
#     def raw_node_append(nodes, raw, degree_type):        
# def message_time_graph(log_dict, nicks, nick_same_list, DAY_BY_DAY_ANALYSIS=False):
#     def compare_spliced_nick(nick_to_compare, spliced_nick, nick_name, line):
# def message_number_bins_csv(log_dict, nicks, nick_same_list):
#     def bin_increment(nick_name, messager, nick_spliced, bins, bin_index):
# def degree_node_number_csv(log_dict, nicks, nick_same_list):
#     def format_degree_list(degree_list, max_range, degree_type):
# def nick_receiver_from_conn_comp(nick, conn_comp_list):
# def identify_hubs_and_experts(log_dict, nicks, nick_same_list):
#     G = util.to_graph(nick_same_list)
#     G = util.to_graph(nick_same_list)


# Path: test/functional-test/test_dataset.py
import unittest
import os
import lib.slack.in_out.reader as reader
import lib.slack.nickTracker as nickTracker
from lib.slack.analysis import network



class DataSetTest(unittest.TestCase):

    def setUp(self):
        self.current_directory = os.path.dirname(os.path.realpath(__file__))
        self.log_data_dir = self.current_directory+"/data/input/slackware/"
        self.start_date = '2013-01-01'
        self.end_date  ='2013-01-08'
        self.expected_result = 137,1754

    def tearDown(self):
        self.current_directory = None
        self.log_data_dir = None
        self.start_date = None
        self.end_date = None
        self.expected_result = None

    def test_dataset(self):
        log_data = reader.linux_input_slack(self.log_data_dir, self.start_date, self.end_date)
        nicks, nick_same_list = nickTracker.nick_tracker(log_data)

        message_number_graph = network.message_number_graph(log_data, nicks, nick_same_list, False)