initial commit

This commit is contained in:
root
2025-10-11 17:03:02 +02:00
commit 08dbb6210e
51 changed files with 3420 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import unittest
from {{ package_name }} import greeter
class TestGreeter(unittest.TestCase):
def test_get_greeting(self) -> None:
self.assertEqual(greeter.Greeter("World").get_greeting(), "Hello World!")

View File

@@ -0,0 +1,24 @@
import io
import unittest
import unittest.mock
import numpy as np
from {{ package_name }} import main
class TestMain(unittest.TestCase):
def test_get_np_array(self) -> None:
np.testing.assert_array_equal(main.get_np_array(), np.array([0]))
@unittest.mock.patch("sys.stdout", new_callable=io.StringIO)
def test_main(self, mock_stdout: unittest.mock.Mock) -> None:
"""Test main method by executing it and comparing terminal output to expected values."""
main.main("world")
# Go to beginning of output
mock_stdout.seek(0)
self.assertEqual(mock_stdout.readline(), "Hello world!\n")
self.assertEqual(
mock_stdout.readline(),
"Here's a test that poetry dependencies are installed: [0]\n",
)