Skip to content

Commit

Permalink
Add a more complex alias test
Browse files Browse the repository at this point in the history
Ensure you can provide an function in an external
alias and execute with arguments provided to it
  • Loading branch information
kyleknap committed Nov 30, 2016
1 parent 6e552a5 commit 1e7510f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/functional/test_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import os

from awscli.alias import AliasLoader
from awscli.testutils import skip_if_windows
from awscli.testutils import FileCreator
from awscli.testutils import BaseAWSCommandParamsTest

Expand Down Expand Up @@ -209,3 +210,12 @@ def test_external_alias_then_additonal_args(self):
self.add_alias('mkdir', '!mkdir')
self.run_cmd('mkdir %s' % directory_to_make)
self.assertTrue(os.path.isdir(directory_to_make))

@skip_if_windows('Windows does not support BASH functions')
def test_external_alias_with_wrapper_bash_function(self):
# The external alias is tested by using mkdir; a command that
# is universal for the various OS's we support
directory_to_make = os.path.join(self.files.rootdir, 'newdir')
self.add_alias('mkdir', '!f() { mkdir "${1}"; }; f')
self.run_cmd('mkdir %s' % directory_to_make)
self.assertTrue(os.path.isdir(directory_to_make))

0 comments on commit 1e7510f

Please sign in to comment.