Taragolis commented on code in PR #34225:
URL: https://github.com/apache/airflow/pull/34225#discussion_r1487018557


##########
airflow/providers/amazon/aws/links/emr.py:
##########
@@ -66,3 +82,111 @@ def get_log_uri(
         return None
     log_uri = S3Hook.parse_s3_url(cluster_info["LogUri"])
     return "/".join(log_uri)
+
+
+class EmrServerlessLogsLink(BaseAwsLink):

Review Comment:
   You could try something like that, just replace to more appropriate test 
values
   
   ```python
   
   ...
   
   @pytest.fixture
   def mocked_emr_serverless_hook():
       with 
mock.patch("airflow.providers.amazon.aws.links.emr.EmrServerlessHook") as m:
           yield m
   
   ...
   
   class TestEmrServerlessDashboardLink(BaseAwsLinksTestCase):
       link_class = EmrServerlessDashboardLink
   
       def test_extra_link(self, mocked_emr_serverless_hook):
           mocked_client = mocked_emr_serverless_hook.return_value.conn
           mocked_client.get_dashboard_for_job_run.return_value = {"url": 
"https://foo/bar"}
   
           self.assert_extra_link_url(
               expected_url="https://foo/bar";,
               conn_id="aws-test",
               application_id="Foo",
               job_run_id="test-run-id",
           )
   
           mocked_emr_serverless_hook.assert_called_with(
               aws_conn_id="aws-test", config={"retries": 
{"total_max_attempts": 1}}
           )
           mocked_client.get_dashboard_for_job_run.assert_called_with(
               applicationId="Foo",
               jobRunId="test-run-id",
           )
   ```



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