You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/08/26 15:23:28 UTC

[GitHub] [airflow] ashb commented on a change in pull request #5358: [AIRFLOW-4085] FileSensor - adding wildcard option

ashb commented on a change in pull request #5358: [AIRFLOW-4085] FileSensor - adding wildcard option
URL: https://github.com/apache/airflow/pull/5358#discussion_r317654633
 
 

 ##########
 File path: tests/contrib/sensors/test_file_sensor.py
 ##########
 @@ -134,6 +135,56 @@ def test_default_fs_conn_id(self):
             task.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE,
                      ignore_ti_state=True)
 
+    def test_wildcard_file(self):
+        suffix = '.txt'
+        with tempfile.NamedTemporaryFile(suffix=suffix) as tmp:
+            fileglob = os.path.join(os.path.dirname(tmp.name), '*' + suffix)
+            task = FileSensor(
+                task_id='test',
+                filepath=fileglob,
+                fs_conn_id='fs_default',
+                dag=self.dag,
+                timeout=0,
+            )
+            task._hook = self.hook
+            task.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE,
 
 Review comment:
   This doesn't doesn't assert wether the task succeeds or fails does it?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services