Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Sep 22, 2014
1 parent c16c392 commit 6b0002f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/pyspark/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,17 @@ def func():
from userlib import UserClass
self.assertEqual("Hello World from inside a package!", UserClass().hello())

def test_overwrite_system_module(self):
self.sc.addPyFile("python/test_support/SimpleHTTPServer.py")
import SimpleHTTPServer
self.assertEqual("My Server", SimpleHTTPServer.__name__)

def func(x):
import SimpleHTTPServer
return SimpleHTTPServer.__name__

self.assertEqual(["My Server"], self.sc.parallelize(range(1)).map(func).collect())


class TestRDDFunctions(PySparkTestCase):

Expand Down
2 changes: 2 additions & 0 deletions python/test_support/SimpleHTTPServer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

__name__ = "My Server"

0 comments on commit 6b0002f

Please sign in to comment.