WeiZhong94 commented on a change in pull request #8719: [FLINK-12767][python]
Support user defined connectors/format
URL: https://github.com/apache/flink/pull/8719#discussion_r294743095
##########
File path: flink-python/pyflink/table/tests/test_descriptor.py
##########
@@ -354,6 +355,24 @@ def test_connection_path_prefix(self):
self.assertEqual(expected, properties)
+class CustomConnectorDescriptorTests(PyFlinkTestCase):
+
+ def test_custom_connector(self):
+ custom_connector = CustomConnectorDescriptor('kafka', 1, True)
+
+ custom_connector = custom_connector\
+ .property('connector.topic', 'topic1')\
+ .properties({'connector.version': '0.11',
'connector.startup-mode': 'earliest-offset'})
+
+ properties = custom_connector.to_properties()
+ expected = {'connector.type': 'kafka',
+ 'connector.property-version': '1',
+ 'connector.topic': 'topic1',
+ 'connector.version': '0.11',
+ 'connector.startup-mode': 'earliest-offset'}
+ assert properties == expected
Review comment:
How about use self.assertEqual()?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services