Example #1
0
def test_parse_us_datetime_chat3():
    data = parse_messages([os.path.join(TEST_DATA_LOCATION, '_chat 3.txt')],
                          'John Doe', True)
    df = pd.DataFrame(data, columns=config['ALL_COLUMNS'])
    df_truth = pd.DataFrame(ground_truth_chat3)
    assert len(df_truth) == len(df)
    for i, row in df.iloc[:len(df_truth)].iterrows():
        assert row.timestamp == df_truth.iloc[i].datetime.timestamp()
Example #2
0
def test_parse_chat_info_chat1():
    data = parse_messages([os.path.join(TEST_DATA_LOCATION, '_chat.txt')],
                          'John Doe', True)
    df = pd.DataFrame(data, columns=config['ALL_COLUMNS'])
    df_truth = pd.DataFrame(ground_truth_chat1)
    for i, row in df.iloc[:len(df_truth)].iterrows():
        assert row.text == df_truth.iloc[i].text
        assert row.outgoing == df_truth.iloc[
            i].outgoing  # using `is` doesn't work here (bool vs. np.bool)
        assert row.senderName == df_truth.iloc[i].senderName