/usr/lib/python3/dist-packages/pyraf/gki_sys_tests.py is in python3-pyraf 2.1.14+dfsg-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | """
GKI System tests
The first version of this will be under-representative of the GKI
functionality, but tests will be added over time, as code issues are
researched and addressed.
$Id$
"""
# confidence high
import os, sys
from pyraf import iraf
from pyraf import gki
def psdevs_in_graphcap_test():
""" Verify that the graphcap file supports psdump and psi_land """
is_in_graphcap('psdump')
is_in_graphcap('psi_land')
def is_in_graphcap(devname):
""" Verify that the graphcap file supports a given device name """
gc = gki.getGraphcap()
assert gc, "default graphcap not found"
assert devname in gc, "default graphcap does not support "+devname
theDev = gc[devname]
assert theDev.devname==devname, "Invalid graphcap device for "+devname
def opcodeList_test():
""" Simple aliveness test for the opcode2name dict """
for opc in gki.GKI_ILLEGAL_LIST:
assert gki.opcode2name[opc] == 'gki_unknown'
def controlList_test():
""" Simple aliveness test for the control2name dict """
for ctl in gki.GKI_ILLEGAL_LIST:
assert gki.control2name[ctl] == 'control_unknown'
def run_all():
tsts = sorted([x for x in list(globals().keys()) if x.find('test')>=0], reverse=1)
for t in tsts:
func = eval(t)
print(func.__doc__.strip())
func()
# If we get here with no exception, we have passed all of the tests
print("\nSuccessfully passed "+str(len(tsts))+" tests")
return len(tsts)
#
# main routine
#
if (__name__ == '__main__'):
run_all()
|