Source
xxxxxxxxxx
self.assertTrue(imhead(imagename=imagename, mode="put", hdkey=key, hdvalue=qa.quantity("3arcsec")))
##########################################################################
# imhead_test.py
#
# Copyright (C) 2008, 2009
# Associated Universities, Inc. Washington DC, USA.
#
# This scripts free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
#
# Correspondence concerning AIPS++ should be adressed as follows:
# Internet email: aips2-request@nrao.edu.
# Postal address: AIPS++ Project Office
# National Radio Astronomy Observatory
# 520 Edgemont Road
# Charlottesville, VA 22903-2475 USA
#
# <author>
# Shannon Jaeger (University of Calgary)
# </author>
#
# <summary>
# Test suite for the CASA imhead Task
# </summary>
#
# <reviewed reviwer="" date="" tests="" demos="">
# </reviewed
#
# <prerequisite>
# <ul>
# <li> <linkto class="imhead.py:description">imhead</linkto>
# </ul>
# </prerequisite>
#
# <etymology>
# imhead_test stands for image header test
# </etymology>
#
# <synopsis>
# imhead_test.py is a Python script that tests the correctness
# of the imhead task in CASA. This is essentially a unit test
# for the imhead task.
#
# However, it is also used as a regression test for the imhead task.
#
# </synopsis>
#
# <example>
# # This test was designed to run using the CASA unit test system.
# # This example shows who to run it manually from within casapy.
# runUnitTest.main(['test_imhead'])
#
# or outside casapy like this:
# casapy -c runUnitTest.py test_imhead
#
# </example>
#
# <motivation>
# To provide a test standard to the imhead task to try and ensure
# coding changes do not break the
# </motivation>
#
# <todo>
# 1. produce summary data
# 2 make sure failure_msgs is used everywere, and display them#
# </todo>
#
#
# SDJ Sep. 8, 2008 Created.
# SDJ May 20, 2009 Updated to testing Framework
###########################################################################
import numpy
import os
import shutil
import casac
from tasks import *
from taskinit import *
import commands
import unittest