From aa236775bab6b8c2a9ec5e2e7f3f28cc4e75f70e Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Fri, 21 Mar 2025 15:26:46 +0100 Subject: [PATCH] tests: add some tests to test the methods of Haiku Refs: OPS-70 --- tests/test_tests.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/test_tests.py b/tests/test_tests.py index 58ab3fa..eac199e 100644 --- a/tests/test_tests.py +++ b/tests/test_tests.py @@ -4,12 +4,14 @@ from __future__ import annotations import os +import json # do not remove this import. This is needed for # pytest fixtures to work import pytest # noqa: F401 -import senju # noqa: F401 +import senju +from senju.haiku import Haiku # noqa: F401 # Note: these weird arguments are an indicator of what should be dome # before. For example, `temp_data_dir` is a function in `conftest.py`. If we @@ -28,3 +30,20 @@ def test_temp_data_dir(temp_data_dir): with open(testpath, "w") as f: f.write("that dir actually works") os.remove(testpath) + + +def test_create_haiku(): + haiku = Haiku(["line number 1", "line number 2", "line number 3"]) + print(haiku) + + +def test_get_haiku_json(): + haiku = Haiku(["line number 1", "line number 2", "line number 3"]) + data_raw: str = haiku.get_json() + data = json.loads(data_raw) + print(data) + + +def test_request_haiku(): + haiku = Haiku.request_haiku("apple banana papaya") + print(haiku)