import unittest
from unittest.mock import patch, MagicMock
from universeos.decorators import universe_shadow
from universeos.client import init_universe

class TestDecorators(unittest.TestCase):
    def setUp(self):
        init_universe(gateway_url="http://test-gateway")

    def test_decorator_passthrough(self):
        # Define a function to decorate
        @universe_shadow
        def my_function(x, y):
            return x + y

        # Execute
        result = my_function(10, 20)

        # Verify it returns the primary result
        self.assertEqual(result, 30)

    def test_decorator_preserves_metadata(self):
        @universe_shadow
        def my_function():
            """Docstring"""
            pass

        self.assertEqual(my_function.__name__, "my_function")
        self.assertEqual(my_function.__doc__, "Docstring")

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