liferoad commented on code in PR #34390:
URL: https://github.com/apache/beam/pull/34390#discussion_r2019976687


##########
sdks/python/apache_beam/io/textio_test.py:
##########
@@ -1442,6 +1461,18 @@ def 
test_read_escaped_escapechar_after_splitting_many(self):
     source_test_utils.assert_sources_equal_reference_source(
         reference_source_info, sources_info)
 
+  def test_read_from_text_dirname_error(self):
+    file_pattern = 'abcd_test'
+    expected_error_message = (
+        "Path type should be local path or GCS path "
+        "when calling ReadFromText")
+
+    with unittest.mock.patch('os.path.dirname') as mock_dirname:
+      mock_dirname.side_effect = TypeError(expected_error_message)

Review Comment:
   The code changes are quite clear in sdks/python/apache_beam/io/textio.py. We 
mock TypeError and then this causes the OS error since the test file does not 
exist. This mainly tests TypeError is captured and passes. 



-- 
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: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to