antony0016 commented on code in PR #5964: URL: https://github.com/apache/gravitino/pull/5964#discussion_r1906951759
########## clients/client-python/tests/unittests/rel/test_partitions.py: ########## @@ -0,0 +1,80 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import unittest +from datetime import date + +from gravitino.api.expressions.literals.literals import Literals +from gravitino.api.expressions.partitions.partitions import Partitions + + +class TestPartitions(unittest.TestCase): Review Comment: Maybe we should add some test cases for the `__eq__` method in the unittest? Here's an example: ``` partition1 = Partitions.range("p1", Literals.NULL, Literals.integer_literal(6), {}) partition2 = Partitions.range("p1", Literals.NULL, Literals.integer_literal(6), {}) partition3 = Partitions.range("p2", Literals.NULL, Literals.integer_literal(10), {}) # Test same objects are equal self.assertEqual(partition1, partition2) # Should be equal self.assertNotEqual(partition1, partition3) # Should not be equal # Test different objects are not equal partition4 = Partitions.range("p1", Literals.NULL, Literals.integer_literal(10), {}) self.assertNotEqual(partition1, partition4) # Test comparison with different types self.assertNotEqual(partition1, "not_a_partition") # Different type self.assertNotEqual(partition1, None) # NoneType ``` -- 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]
