jerryshao commented on code in PR #9944:
URL: https://github.com/apache/gravitino/pull/9944#discussion_r2796590826


##########
clients/client-python/tests/unittests/test_requests.py:
##########
@@ -266,3 +272,44 @@ def test_table_create_request(self):
             with self.assertRaisesRegex(IllegalArgumentException, 
exception_str):
                 req = TableCreateRequest.from_json(json_str)
                 req.validate()
+
+    def test_function_register_request(self):
+        """Test FunctionRegisterRequest."""
+        req = FunctionRegisterRequest(
+            name="func1",
+            function_type=FunctionType.SCALAR,
+            deterministic=True,
+            definitions=[],
+            comment="comment",
+        )
+        json_data = json.loads(req.to_json())
+        self.assertEqual("func1", json_data["name"])
+        self.assertEqual("scalar", json_data["functionType"])
+        self.assertTrue(json_data["deterministic"])
+        self.assertEqual("comment", json_data["comment"])
+
+        # Test request without required fields
+        with self.assertRaises(IllegalArgumentException):
+            FunctionRegisterRequest(
+                name="func1",
+                function_type=None,
+                deterministic=True,
+                definitions=[],
+            ).validate()
+
+    def test_function_update_request(self):

Review Comment:
   I think you should also add other update request tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to