# Path: lib/analysis/channel.py
# def conv_len_conv_refr_time(log_dict, nicks, nick_same_list, rt_cutoff_time, cutoff_percentile):
#     def build_conversation(rec_list, nick, send_time, nick_to_search,
#                            nick_receiver, nick_sender, dateadd,
#                            conversations, conn_comp_list, line):
#     def conv_helper(rec, nick, send_time, nick_to_search, nick_receiver,
#                     nick_sender, dateadd, conversations, conn_comp_list, line):
#     def conv_mat_diff(i,j,conversations):
#     def conv_append(conversations, index, dateadd, line):
#     def parse_log_lines_for_conv(log_dict, nicks, conn_comp_list, conversations):
# def response_time(log_dict, nicks, nick_same_list, cutoff_percentile):
#     def build_mean_list(conversations, index, mean_list):
#     def resp_helper(rec, nick, send_time, nick_to_search, nick_receiver, nick_sender, conversations, conn_comp_list):
# def build_stat_dist(number_list):
# def truncate_table(table, cutoff_percentile):
#     G = util.to_graph(nick_same_list)
#     G = util.to_graph(nick_same_list)


import unittest
import lib.util as util
import os
from lib.analysis import channel


class ChannelTest(unittest.TestCase):

    def setUp(self):
        current_directory = os.path.dirname(os.path.abspath(__file__))
        self.test_data_dir = current_directory + "/../../../data/test_lib/test_analysis/"
        self.log_data = util.load_from_disk(self.test_data_dir+ "/channel/log_data")
        self.nicks = util.load_from_disk(self.test_data_dir+ "/channel/nicks")
        self.nick_same_list = util.load_from_disk(self.test_data_dir+ "/channel/nick_same_list")

    def tearDown(self):
        self.test_data_dir = None
        self.log_data = None
        self.nicks = None
        self.nick_same_list = None

    def test_conv_len_conv_refr_time(self):
        rt_cutoff_time = 1
        cutoff_percentile = 0
        expected_conv_len = util.load_from_disk(self.test_data_dir + "/channel/conv_len")
        expected_conv_ref_time = util.load_from_disk(self.test_data_dir+ "/channel/conv_ref_time")

        conv_len, conv_ref_time = \

# Path: lib/analysis/channel.py
# def conv_len_conv_refr_time(log_dict, nicks, nick_same_list, rt_cutoff_time, cutoff_percentile):
#     def build_conversation(rec_list, nick, send_time, nick_to_search,
#                            nick_receiver, nick_sender, dateadd,
#                            conversations, conn_comp_list, line):
#     def conv_helper(rec, nick, send_time, nick_to_search, nick_receiver,
#                     nick_sender, dateadd, conversations, conn_comp_list, line):
#     def conv_mat_diff(i,j,conversations):
#     def conv_append(conversations, index, dateadd, line):
#     def parse_log_lines_for_conv(log_dict, nicks, conn_comp_list, conversations):
# def response_time(log_dict, nicks, nick_same_list, cutoff_percentile):
#     def build_mean_list(conversations, index, mean_list):
#     def resp_helper(rec, nick, send_time, nick_to_search, nick_receiver, nick_sender, conversations, conn_comp_list):
# def build_stat_dist(number_list):
# def truncate_table(table, cutoff_percentile):
#     G = util.to_graph(nick_same_list)
#     G = util.to_graph(nick_same_list)


# Path: test/integration-test/test_lib/test_analysis/test_channel.py
import unittest
import lib.util as util
import os
from lib.analysis import channel



class ChannelTest(unittest.TestCase):

    def setUp(self):
        current_directory = os.path.dirname(os.path.abspath(__file__))
        self.test_data_dir = current_directory + "/../../../data/test_lib/test_analysis/"
        self.log_data = util.load_from_disk(self.test_data_dir+ "/channel/log_data")
        self.nicks = util.load_from_disk(self.test_data_dir+ "/channel/nicks")
        self.nick_same_list = util.load_from_disk(self.test_data_dir+ "/channel/nick_same_list")

    def tearDown(self):
        self.test_data_dir = None
        self.log_data = None
        self.nicks = None
        self.nick_same_list = None

    def test_conv_len_conv_refr_time(self):
        rt_cutoff_time = 1
        cutoff_percentile = 0
        expected_conv_len = util.load_from_disk(self.test_data_dir + "/channel/conv_len")
        expected_conv_ref_time = util.load_from_disk(self.test_data_dir+ "/channel/conv_ref_time")

        conv_len, conv_ref_time = \

            channel.conv_len_conv_refr_time(self.log_data, self.nicks, self.nick_same_list,