# Файл: georgeinn/tests/test_basic.py
import unittest
import sys
import os

# Добавляем путь к пакету
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from georgeinn import add, subtract, multiply, divide


class TestBasicMath(unittest.TestCase):
    def test_add(self):
        self.assertEqual(add(2, 3), 5)
        self.assertEqual(add(-1, 1), 0)

    def test_subtract(self):
        self.assertEqual(subtract(5, 3), 2)
        self.assertEqual(subtract(0, 5), -5)

    def test_multiply(self):
        self.assertEqual(multiply(3, 4), 12)
        self.assertEqual(multiply(0, 5), 0)

    def test_divide(self):
        self.assertEqual(divide(10, 2), 5)
        self.assertEqual(divide(5, 2), 2.5)

        # Проверка деления на ноль
        with self.assertRaises(ValueError):
            divide(5, 0)


if __name__ == '__main__':
    unittest.main()