Ejemplo n.º 1
0
class TestCondor(unittest.TestCase):

    def setUp(self):
        """ Setup a test environment """
        self.job = CondorJob( 'test/test.submit', db_path='job.db', verbose=True)

    def tearDown(self):
        time.sleep( SLEEP_TIME )
        for f in glob.iglob( 'test/log.*' ):
            os.unlink( f )
        for f in glob.iglob( 'test/job.db' ):
            os.unlink( f )
        for f in glob.iglob( 'test/results_data_out' ):
            os.unlink( f )


    def testSubmit( self ):
        """ Test job submission CONDOR """
        saved_stdout = sys.stdout
        try:
            out = StringIO()
            sys.stdout = out

            self.job.submit()

            output = out.getvalue().strip()
            assert output.find('Submitting job(s)')

        finally:

            sys.stdout = saved_stdout


    def testKill( self ):
        """ Test job remove CONDOR """
        saved_stdout = sys.stdout
        try:
            out = StringIO()
            sys.stdout = out

            self.job.kill()

            output = out.getvalue().strip()
            assert output.find('job(s) have been marked for removal.')

        finally:

            sys.stdout = saved_stdout
Ejemplo n.º 2
0
class TestCondor(unittest.TestCase):
    def setUp(self):
        """ Setup a test environment """
        self.job = CondorJob('test/test.submit',
                             db_path='job.db',
                             verbose=True)

    def tearDown(self):
        time.sleep(SLEEP_TIME)
        for f in glob.iglob('test/log.*'):
            os.unlink(f)
        for f in glob.iglob('test/job.db'):
            os.unlink(f)
        for f in glob.iglob('test/results_data_out'):
            os.unlink(f)

    def testSubmit(self):
        """ Test job submission CONDOR """
        saved_stdout = sys.stdout
        try:
            out = StringIO()
            sys.stdout = out

            self.job.submit()

            output = out.getvalue().strip()
            assert output.find('Submitting job(s)')

        finally:

            sys.stdout = saved_stdout

    def testKill(self):
        """ Test job remove CONDOR """
        saved_stdout = sys.stdout
        try:
            out = StringIO()
            sys.stdout = out

            self.job.kill()

            output = out.getvalue().strip()
            assert output.find('job(s) have been marked for removal.')

        finally:

            sys.stdout = saved_stdout
Ejemplo n.º 3
0
 def setUp(self):
     """ Setup a test environment """
     self.job = CondorJob('test/test.submit',
                          db_path='job.db',
                          verbose=True)
Ejemplo n.º 4
0
 def setUp(self):
     """ Setup a test environment """
     self.job = CondorJob( 'test/test.submit', db_path='job.db', verbose=True)