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# This file is part of utils. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

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

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

7# for details of code ownership. 

8# 

9# Use of this source code is governed by a 3-clause BSD-style 

10# license that can be found in the LICENSE file. 

11 

12import unittest 

13import os 

14import lsst.utils.tests 

15 

16 

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

18 

19 def testSimpleExe(self): 

20 """Test explicit shell script""" 

21 self.assertExecutable("testexe.sh", 

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

23 args=["-h"], 

24 msg="testexe.sh failed") 

25 

26 # Try a non-existent test 

27 with self.assertRaises(AssertionError): 

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

29 

30 # Force test to fail, explicit fail message 

31 with self.assertRaises(AssertionError): 

32 self.assertExecutable("testexe.sh", 

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

34 args=["-f"], 

35 msg="testexe.sh failed") 

36 

37 # Force script to fail, default fail message 

38 with self.assertRaises(AssertionError): 

39 self.assertExecutable("testexe.sh", 

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

41 args=["-f"]) 

42 

43 

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

45 pass 

46 

47 

48EXECUTABLES = None 

49UtilsBinaryTester.create_executable_tests(__file__, EXECUTABLES) 

50 

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

52 unittest.main()