Skip to content

Commit

Permalink
Update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
howl-anderson committed Sep 2, 2018
1 parent 110db95 commit 4f065d2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
8 changes: 0 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,5 @@ def train_test_cases():
for i in range(1, 4):
test_cases.append([basic_test_case] * i)

# add test case for integer division easily happened in python 2
test_cases.append(
[
[('A', 'a'), ('B', 'b')],
[('A', 'c'), ('B', 'd')]
]
)

# return as list of list
return test_cases
15 changes: 15 additions & 0 deletions tests/test_hmm_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,18 @@ def test_hmm_train(train_data):
result = hmm_model.predict([i[0] for i in first_train_data])

assert first_train_data == result


def test_hmm_math_error():
"""add test case for integer division easily happened in python 2"""

hmm_model = HMMModel()
train_data = [
[('A', 'a'), ('B', 'b')],
[('A', 'c'), ('B', 'd')]
]

for single_train_data in train_data:
hmm_model.train_one_line(single_train_data)

hmm_model.do_train()

0 comments on commit 4f065d2

Please sign in to comment.