great-ai/good_ai/tests/sus/test_get_sentences.py
András Schmelczer 889e79174b
Add files
Signed-off-by: András Schmelczer <andras@schmelczer.dev>
2022-04-02 13:47:33 +02:00

16 lines
608 B
Python

import unittest
from src.sus.get_sentences import get_sentences
class TestGetSentences(unittest.TestCase):
def test_default(self) -> None:
text = "This is a complete sentence. So is this. However this is n" # ot.
expected = ["This is a complete sentence.", "So is this.", "However this is n"]
self.assertEqual(get_sentences(text), expected)
self.assertEqual(get_sentences(text, ignore_partial=True), expected[0:2])
def test_empty(self) -> None:
self.assertEqual(get_sentences(""), [])
self.assertEqual(get_sentences("", ignore_partial=True), [])