Coverage for tests/test_load.py: 48%

21 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-04-27 11:23 +0000

1 

2import os.path 

3import unittest 

4 

5from lsst.ctrl.execute import envString 

6from lsst.ctrl.execute.allocationConfig import AllocationConfig 

7from lsst.ctrl.execute.condorConfig import CondorConfig 

8 

9TESTDIR = os.path.abspath(os.path.dirname(__file__)) 

10 

11 

12class S3DFSimpleTestCase(unittest.TestCase): 

13 """Test basic configuration reading.""" 

14 

15 def test_exec_config(self): 

16 exec_config_name = os.path.join(TESTDIR, os.pardir, "etc", "config", "execConfig.py") 

17 

18 resolved_name = envString.resolve(exec_config_name) 

19 configuration = CondorConfig() 

20 configuration.load(resolved_name) 

21 self.assertEqual(configuration.platform.scheduler, "slurm") 

22 

23 def test_allocation_config(self): 

24 slurm_config_name = os.path.join(TESTDIR, os.pardir, "etc", "config", "slurmConfig.py") 

25 

26 resolved_name = envString.resolve(slurm_config_name) 

27 configuration = AllocationConfig() 

28 configuration.load(resolved_name) 

29 self.assertEqual(configuration.platform.queue, "$QUEUE") 

30 

31 

32if __name__ == "__main__": 32 ↛ 33line 32 didn't jump to line 33, because the condition on line 32 was never true

33 unittest.main()