|
"""Test convbot.""" |
|
|
|
import pytest |
|
|
|
from convbot import __version__ |
|
from convbot import convbot, aconvbot |
|
|
|
pytestmark = pytest.mark.asyncio |
|
|
|
|
|
def test_version(): |
|
"""Test version.""" |
|
assert __version__ == "0.1.0" |
|
|
|
|
|
def test_sanity(): |
|
"""Sanity check.""" |
|
try: |
|
assert not convbot("") |
|
except Exception: |
|
assert True |
|
|
|
|
|
def test_convbot(): |
|
"""Test convbot.""" |
|
resp = convbot("How are you?") |
|
assert len(resp) > 3 |
|
|
|
|
|
resp = convbot("How old are you?") |
|
assert len(resp) > 3 |
|
|
|
|
|
async def tests_aconvbot(): |
|
"""Test aconvbot.""" |
|
resp = await aconvbot("How are you?") |
|
assert len(resp) > 3 |
|
|
|
|
|
resp = await aconvbot("How old are you?") |
|
assert len(resp) > 3 |
|
|