Skip to content

Commit

Permalink
Merge pull request #17 from htssouza/conf-tests2
Browse files Browse the repository at this point in the history
  • Loading branch information
wdm0006 committed Jun 24, 2016
2 parents a97a73d + 71f57b8 commit 1481038
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dummy_spark/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@


class SparkConf(object):

DEBUG_STRING = 'no string for dummy version'

def __init__(self, loadDefaults=True, _jvm=None, _jconf=None):
self.conf = {}

Expand Down Expand Up @@ -58,4 +61,4 @@ def contains(self, key):
return key in self.conf.keys()

def toDebugString(self):
return 'no string for dummy version'
return self.DEBUG_STRING
6 changes: 6 additions & 0 deletions tests/unit/test_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def test_set_if_missing(self):
conf.set(self.RANDOM_KEY, self.RANDOM_VALUE)
conf.setIfMissing(self.RANDOM_KEY, self.RANDOM_VALUE2)
self.assertEquals(conf.get(self.RANDOM_KEY), self.RANDOM_VALUE)
conf.setIfMissing(self.RANDOM_KEY2, self.RANDOM_VALUE2)
self.assertEquals(conf.get(self.RANDOM_KEY2), self.RANDOM_VALUE2)

def test_set_executor_env1(self):
conf = SparkConf()
Expand Down Expand Up @@ -75,3 +77,7 @@ def test_get_all(self):
(self.RANDOM_KEY2, self.RANDOM_VALUE2)]
conf.setAll(pairs)
self.assertEquals(sorted(conf.getAll()), sorted(pairs))

def test_to_debug_string(self):
conf = SparkConf()
self.assertEquals(conf.toDebugString(), SparkConf.DEBUG_STRING)

0 comments on commit 1481038

Please sign in to comment.