Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# 

2# Developed for the LSST Data Management System. 

3# This product includes software developed by the LSST Project 

4# (https://www.lsst.org). 

5# See the COPYRIGHT file at the top-level directory of this distribution 

6# for details of code ownership. 

7# 

8# This program is free software: you can redistribute it and/or modify 

9# it under the terms of the GNU General Public License as published by 

10# the Free Software Foundation, either version 3 of the License, or 

11# (at your option) any later version. 

12# 

13# This program is distributed in the hope that it will be useful, 

14# but WITHOUT ANY WARRANTY; without even the implied warranty of 

15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

16# GNU General Public License for more details. 

17# 

18# You should have received a copy of the GNU General Public License 

19# along with this program. If not, see <https://www.gnu.org/licenses/>. 

20# 

21 

22 

23import unittest 

24import os 

25import lsst.utils.tests 

26 

27 

28class ExplicitBinaryTester(lsst.utils.tests.ExecutablesTestCase): 

29 

30 def testSimpleExe(self): 

31 """Test explicit shell script""" 

32 self.assertExecutable("testexe.sh", 

33 root_dir=os.path.dirname(__file__), 

34 args=["-h"], 

35 msg="testexe.sh failed") 

36 

37 # Try a non-existent test 

38 with self.assertRaises(AssertionError): 

39 self.assertExecutable("testexe-missing.sh") 

40 

41 # Force test to fail, explicit fail message 

42 with self.assertRaises(AssertionError): 

43 self.assertExecutable("testexe.sh", 

44 root_dir=os.path.dirname(__file__), 

45 args=["-f"], 

46 msg="testexe.sh failed") 

47 

48 # Force script to fail, default fail message 

49 with self.assertRaises(AssertionError): 

50 self.assertExecutable("testexe.sh", 

51 root_dir=os.path.dirname(__file__), 

52 args=["-f"]) 

53 

54 

55class UtilsBinaryTester(lsst.utils.tests.ExecutablesTestCase): 

56 pass 

57 

58 

59EXECUTABLES = None 

60UtilsBinaryTester.create_executable_tests(__file__, EXECUTABLES) 

61 

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

63 unittest.main()