Skip to content

Commit

Permalink
start test cases for utility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
baijum committed May 19, 2010
1 parent 1b8a4a9 commit 1e0d213
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/zope/mkzeoinstance/tests/test_unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import cStringIO

from zope.mkzeoinstance import ZEOInstanceBuilder

from zope.mkzeoinstance import mkdirs

class ZeoInstanceParamsTest(unittest.TestCase):

Expand Down Expand Up @@ -69,7 +69,7 @@ def setUp(self):

def tearDown(self):
shutil.rmtree(self.temp_dir)

def test_create_folders_and_files(self):
instance_home = self.instance_home
orig_stdout = sys.stdout
Expand Down Expand Up @@ -197,10 +197,24 @@ def test_zeoctl_content(self):
'executable': sys.executable}

self.assertEqual(zeoctl, expected_out)



class UtilityFunctionsTest(unittest.TestCase):

def setUp(self):
self.temp_dir = tempfile.mkdtemp()

def tearDown(self):
shutil.rmtree(self.temp_dir)

def test_mkdirs(self):
path = os.path.join(self.temp_dir, 'test')
mkdirs(path)
self.assertTrue(os.path.exists(path))

def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(ZeoInstanceParamsTest))
suite.addTest(unittest.makeSuite(ZeoInstanceCreateTest))
suite.addTest(unittest.makeSuite(UtilityFunctionsTest))
return suite

0 comments on commit 1e0d213

Please sign in to comment.