potiuk commented on code in PR #46096:
URL: https://github.com/apache/airflow/pull/46096#discussion_r1944252718


##########
providers/tests/amazon/aws/transfers/test_http_to_s3.py:
##########
@@ -60,12 +60,34 @@ def test_execute(self, requests_mock):
         conn = boto3.client("s3")
         conn.create_bucket(Bucket=self.s3_bucket)
         operator = HttpToS3Operator(
-            task_id="s3_to_file_sensor",
+            task_id="http_to_s3_operator",
+            http_conn_id=self.http_conn_id,
+            endpoint=self.endpoint,
+            s3_key=self.s3_key,
+            s3_bucket=self.s3_bucket,
+            dag=self.dag,
+        )
+        operator.execute(None)
+
+        objects_in_bucket = conn.list_objects(Bucket=self.s3_bucket, 
Prefix=self.s3_key)
+        # there should be object found, and there should only be one object 
found
+        assert len(objects_in_bucket["Contents"]) == 1
+        # the object found should be consistent with dest_key specified earlier
+        assert objects_in_bucket["Contents"][0]["Key"] == self.s3_key
+
+    @mock_aws
+    def test_execute_stream(self, requests_mock):
+        requests_mock.register_uri("GET", EXAMPLE_URL, content=self.response)
+        conn = boto3.client("s3")
+        conn.create_bucket(Bucket=self.s3_bucket)
+        operator = HttpToS3Operator(
+            task_id="http_to_s3_operator",
             http_conn_id=self.http_conn_id,
             endpoint=self.endpoint,
             s3_key=self.s3_key,
             s3_bucket=self.s3_bucket,
             dag=self.dag,
+            extra_options={"stream": True},
         )
         operator.execute(None)
 

Review Comment:
   What's the problem @rogalski ? Can we help somehow? For the local dev env 
now we recommend `uv` and simple `uv sync --extra amazon` should **just** work 
-> it shoudl autoamatically install `python`, create `.venv` with all necessary 
libraries for amazon. See our "local virtualenv" documentation in contributing 
guide: 
https://github.com/apache/airflow/blob/main/contributing-docs/07_local_virtualenv.rst



-- 
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