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

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

33

34

35

36

37

38

39

40

41

import unittest 

import os 

import lsst.utils.tests 

 

 

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

 

def testSimpleExe(self): 

"""Test explicit shell script""" 

self.assertExecutable("testexe.sh", 

root_dir=os.path.dirname(__file__), 

args=["-h"], 

msg="testexe.sh failed") 

 

# Try a non-existent test 

with self.assertRaises(AssertionError): 

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

 

# Force test to fail, explicit fail message 

with self.assertRaises(AssertionError): 

self.assertExecutable("testexe.sh", 

root_dir=os.path.dirname(__file__), 

args=["-f"], 

msg="testexe.sh failed") 

 

# Force script to fail, default fail message 

with self.assertRaises(AssertionError): 

self.assertExecutable("testexe.sh", 

root_dir=os.path.dirname(__file__), 

args=["-f"]) 

 

 

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

pass 

 

 

EXECUTABLES = None 

UtilsBinaryTester.create_executable_tests(__file__, EXECUTABLES) 

 

40 ↛ 41line 40 didn't jump to line 41, because the condition on line 40 was never trueif __name__ == "__main__": 

unittest.main()