Skip to content

Commit

Permalink
updated tests to include use of sh_bin in bash-wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
David Marin committed Jan 11, 2017
1 parent e858003 commit 384039d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/test_emr.py
Expand Up @@ -3343,15 +3343,15 @@ def test_pre_filters(self):
pre_filter='grep something')))

self.assertEqual(ss['mapper'],
"bash -c 'grep anything | " +
"/bin/sh -ex -c 'grep anything | " +
PYTHON_BIN +
" my_job.py --step-num=0 --mapper'")
self.assertEqual(ss['combiner'],
"bash -c 'grep nothing | " +
"/bin/sh -ex -c 'grep nothing | " +
PYTHON_BIN +
" my_job.py --step-num=0 --combiner'")
self.assertEqual(ss['reducer'],
"bash -c 'grep something | " +
"/bin/sh -ex -c 'grep something | " +
PYTHON_BIN +
" my_job.py --step-num=0 --reducer'")

Expand All @@ -3364,7 +3364,7 @@ def test_pre_filter_escaping(self):

self.assertEqual(
ss['mapper'],
"bash -c 'bash -c '\\''grep"
"/bin/sh -ex -c 'bash -c '\\''grep"
" '\\''\\'\\'''\\''anything'\\''\\'\\'''\\'''\\'' | " +
PYTHON_BIN +
" my_job.py --step-num=0 --mapper'")
Expand Down
8 changes: 4 additions & 4 deletions tests/test_hadoop.py
Expand Up @@ -889,13 +889,13 @@ def test_pre_filters(self):
self.runner._args_for_streaming_step(0),
(self.BASIC_HADOOP_ARGS + self.BASIC_JOB_ARGS + [
'-mapper',
"bash -c 'grep anything | " + PYTHON_BIN +
"sh -ex -c 'grep anything | " + PYTHON_BIN +
" my_job.py --step-num=0 --mapper'",
'-combiner',
"bash -c 'grep nothing | " + PYTHON_BIN +
"sh -ex -c 'grep nothing | " + PYTHON_BIN +
" my_job.py --step-num=0 --combiner'",
'-reducer',
"bash -c 'grep something | " + PYTHON_BIN +
"sh -ex -c 'grep something | " + PYTHON_BIN +
" my_job.py --step-num=0 --reducer'"]))

def test_pre_filter_escaping(self):
Expand All @@ -916,7 +916,7 @@ def test_pre_filter_escaping(self):
['-D', 'mapreduce.job.reduces=0'] +
self.BASIC_JOB_ARGS + [
'-mapper',
"bash -c 'bash -c '\\''grep"
"sh -ex -c 'bash -c '\\''grep"
" '\\''\\'\\'''\\''anything'\\''\\'\\'''\\'''\\'' | " +
PYTHON_BIN +
" my_job.py --step-num=0 --mapper'"]))
Expand Down

0 comments on commit 384039d

Please sign in to comment.