40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Test suite for project_unknown module
|
|
"""
|
|
|
|
import unittest
|
|
import sys
|
|
import os
|
|
|
|
# Add current directory to path so we can import our module
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
from project_unknown import hello_world, add_numbers
|
|
|
|
class TestProjectUnknown(unittest.TestCase):
|
|
"""Test cases for the project_unknown module."""
|
|
|
|
def test_hello_world(self):
|
|
"""Test the hello_world function."""
|
|
result = hello_world()
|
|
self.assertEqual(result, "Hello, World!")
|
|
|
|
def test_add_numbers_positive(self):
|
|
"""Test adding positive numbers."""
|
|
result = add_numbers(2, 3)
|
|
self.assertEqual(result, 5)
|
|
|
|
def test_add_numbers_negative(self):
|
|
"""Test adding negative numbers."""
|
|
result = add_numbers(-1, 1)
|
|
self.assertEqual(result, 0)
|
|
|
|
def test_add_numbers_zero(self):
|
|
"""Test adding zero."""
|
|
result = add_numbers(5, 0)
|
|
self.assertEqual(result, 5)
|
|
|
|
if __name__ == "__main__":
|
|
print("=== Running Project Unknown Test Suite ===")
|
|
unittest.main(verbosity=2) |