Skip to content
This repository has been archived by the owner on Nov 30, 2019. It is now read-only.

Commit

Permalink
SPARK-5361, add in test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Winston Chen committed Jan 22, 2015
1 parent 4cf1187 commit 126be6b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions python/pyspark/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1125,19 +1125,19 @@ def test_oldhadoop(self):

def test_newhadoop(self):
basepath = self.tempdir.name
ints = sorted(self.sc.newAPIHadoopFile(\
basepath + "/sftestdata/sfint/",\
"org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat",\
"org.apache.hadoop.io.IntWritable",\
ints = sorted(self.sc.newAPIHadoopFile(
basepath + "/sftestdata/sfint/",
"org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat",
"org.apache.hadoop.io.IntWritable",
"org.apache.hadoop.io.Text").collect())
ei = [(1, u'aa'), (1, u'aa'), (2, u'aa'), (2, u'bb'), (2, u'bb'), (3, u'cc')]
self.assertEqual(ints, ei)

hellopath = os.path.join(SPARK_HOME, "python/test_support/hello.txt")
newconf = {"mapred.input.dir": hellopath}
hello = self.sc.newAPIHadoopRDD("org.apache.hadoop.mapreduce.lib.input.TextInputFormat",\
"org.apache.hadoop.io.LongWritable",\
"org.apache.hadoop.io.Text",\
hello = self.sc.newAPIHadoopRDD("org.apache.hadoop.mapreduce.lib.input.TextInputFormat",
"org.apache.hadoop.io.LongWritable",
"org.apache.hadoop.io.Text",
conf=newconf).collect()
result = [(0, u'Hello World!')]
self.assertEqual(hello, result)
Expand Down

0 comments on commit 126be6b

Please sign in to comment.