test_BuildJobTests.py 917 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
import unittest
import os
from BuildJobTests import JobFileGenerator

class JobForTest():
    settings = {}
    configuration = {"output_files":{"files":["./File.nc"]}}
    _type = 'Test'
    
    def set_multi_processor(self):
        self.settings = {'running_mode':True}
    
    def set_mono_processor(self):
        self.settings = {}
        
    def get_default_parameters(self):
        return {}

class TestBuildJobTests(unittest.TestCase):
    def test(self):
        temp = os.path.join(os.path.split(__file__)[0], "Test_Test.py")
        self.job = JobForTest()
        self.object = JobFileGenerator(self.job)
        self.assertTrue(os.path.isfile(temp))
        os.remove(temp)
        self.job.set_multi_processor()
        self.object = JobFileGenerator(self.job)
        self.assertTrue(os.path.isfile(temp))
        os.remove(temp)
        
if __name__ == '__main__':
    unittest.main(verbosity=2)