Skip to content

Commit

Permalink
unitests work again
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed Sep 13, 2012
1 parent a46b443 commit 5417ccd
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/python/moa/backend/ruff/test.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@

import unittest2 as unittest
import unittest
import Yaco
from moa.sysConf import sysConf
import moa.job
import moa.logger as l


class templateTest(unittest.TestCase):
"""
Test a ruff template
"""
def setJob(self, job):
def __init__(self, job, *args, **kwargs):
self.job = job
super(templateTest, self).__init__(*args, **kwargs)

def runTest(self):
if not hasattr(self, 'job'):
Expand All @@ -29,14 +32,17 @@ def runTest(self):
self.skipTest("Only testing ruff jobs - not %s" %
templateName)

#if
#if
if not self.job.hasCommand('unittest'):
self.skipTest("no unittest defined for %s" %
templateName)
self.job.prepare()

#self.job.prepare()
sysConf.pluginHandler.run('prepare_3')
rc = self.job.execute("unittest")
dummyargs = Yaco.Yaco()
dummyargs.command = 'unittest'
rc = self.job.execute(self.job, dummyargs)
print rc
self.assertEqual(rc, 0, 'test failed for %s' %
templateName)

Expand Down

0 comments on commit 5417ccd

Please sign in to comment.