File tree 4 files changed +54
-0
lines changed
tests/functional/socialmessaging
4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+ from awscli .customizations .utils import make_hidden_command_alias
14
+
15
+
16
+ def register_alias_socialmessaging_command (event_emitter ):
17
+ event_emitter .register (
18
+ 'building-command-table.socialmessaging' ,
19
+ alias_socialmessaging_command
20
+ )
21
+
22
+
23
+ def alias_socialmessaging_command (command_table , ** kwargs ):
24
+ make_hidden_command_alias (
25
+ command_table ,
26
+ existing_name = 'delete-whatsapp-message-media' ,
27
+ alias_name = 'delete-whatsapp-media-message' ,
28
+ )
Original file line number Diff line number Diff line change 116
116
from awscli .customizations .sessendemail import register_ses_send_email
117
117
from awscli .customizations .sessionmanager import register_ssm_session
118
118
from awscli .customizations .sms_voice import register_sms_voice_hide
119
+ from awscli .customizations .socialmessaging import register_alias_socialmessaging_command
119
120
from awscli .customizations .streamingoutputarg import add_streaming_output_arg
120
121
from awscli .customizations .toplevelbool import register_bool_params
121
122
from awscli .customizations .translate import (
@@ -210,6 +211,7 @@ def awscli_initialize(event_handlers):
210
211
register_alias_opsworks_cm (event_handlers )
211
212
register_alias_mturk_command (event_handlers )
212
213
register_alias_sagemaker_runtime_command (event_handlers )
214
+ register_alias_socialmessaging_command (event_handlers )
213
215
register_servicecatalog_commands (event_handlers )
214
216
register_translate_import_terminology (event_handlers )
215
217
register_history_mode (event_handlers )
Original file line number Diff line number Diff line change
1
+ # Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+ from awscli .testutils import BaseAWSCommandParamsTest
14
+
15
+
16
+ class TestAlias (BaseAWSCommandParamsTest ):
17
+ def test_alias (self ):
18
+ # This command was aliased, both should work
19
+ command_template = ('socialmessaging %s --origination-phone-number-id foo '
20
+ '--media-id bar' )
21
+ old_command = command_template % 'delete-whatsapp-media-message'
22
+ new_command = command_template % 'delete-whatsapp-message-media'
23
+ self .run_cmd (old_command , expected_rc = 0 )
24
+ self .run_cmd (new_command , expected_rc = 0 )
You can’t perform that action at this time.
0 commit comments