-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
36 lines (27 loc) · 777 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
@author: Tilman Kerl
@version: 2020.11.23
---
Test some functions
"""
import os
import sys
import pytest
import pandas as pd
sys.path.insert(0, './src')
from config import test_df
from explore import reduce_df, clean_dataset, parse_sentences, get_distribution
################################################
# TESTING EXPLORE.py
def test_reduce_df():
df = reduce_df(test_df)
assert "segment" in df and "sentiment" in df and len(df.columns) == 2
def test_clean_dataset():
df = clean_dataset(test_df)
assert '\n' not in df.values and "\r" not in df.values
def test_parse_sentences():
df = clean_dataset(test_df)
df = parse_sentences(df)
assert "isSentence" in df
def test_get_distribution():
assert get_distribution(test_df) == True