Skip to content

Commit

Permalink
update rdd tests to test pipe modes
Browse files Browse the repository at this point in the history
  • Loading branch information
megatron-me-uk committed Jun 30, 2015
1 parent 34fcdc3 commit a307d13
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/pyspark/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,10 +878,14 @@ def test_pipe_functions(self):
data = ['1', '2', '3']
rdd = self.sc.parallelize(data)
with QuietTest(self.sc):
self.assertRaises(Py4JJavaError, rdd.pipe('cc').collect)
self.assertEqual([], rdd.pipe('cc').collect())
self.assertRaises(Py4JJavaError, rdd.pipe('cc', mode='strict').collect)
result = rdd.pipe('cat').collect()
result.sort()
[self.assertEqual(x, y) for x, y in zip(data, result)]
self.assertRaises(Py4JJavaError, rdd.pipe('grep 4', mode='strict').collect)
self.assertEqual([], rdd.pipe('grep 4').collect())
self.assertEqual([], rdd.pipe('grep 4', mode='grep').collect())


class ProfilerTests(PySparkTestCase):
Expand Down

0 comments on commit a307d13

Please sign in to comment.