Change-Id: Ic1096b2c6a5a0c5f081d4710ac18b512cdd5b348 Former-commit-id: e5999c9ed5e32317f57c1c0276c3896c17ede363
77 lines
2.3 KiB
Python
77 lines
2.3 KiB
Python
##
|
|
# This software was developed and / or modified by Raytheon Company,
|
|
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
|
#
|
|
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
|
# This software product contains export-restricted data whose
|
|
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
|
# to non-U.S. persons whether in the United States or abroad requires
|
|
# an export license or other authorization.
|
|
#
|
|
# Contractor Name: Raytheon Company
|
|
# Contractor Address: 6825 Pine Street, Suite 340
|
|
# Mail Stop B8
|
|
# Omaha, NE 68106
|
|
# 402.291.0100
|
|
#
|
|
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
|
# further licensing information.
|
|
##
|
|
|
|
from __future__ import print_function
|
|
from ufpy.dataaccess import DataAccessLayer as DAL
|
|
|
|
import baseDafTestCase
|
|
import dafTestsArgsUtil
|
|
import sys
|
|
import unittest
|
|
|
|
class ClimateTestCase(baseDafTestCase.DafTestCase):
|
|
"""
|
|
Tests that climate data can be retrieved through the DAF, simply ensuring
|
|
that no unexpected exceptions are thrown while retrieving it and that the
|
|
returned data is not None.
|
|
"""
|
|
|
|
datatype = "climate"
|
|
|
|
table = "public.cli_asos_monthly"
|
|
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
print("STARTING CLIMATE TESTS\n\n")
|
|
|
|
def testParameters(self):
|
|
req = DAL.newDataRequest(self.datatype)
|
|
req.addIdentifier("table", self.table)
|
|
|
|
self.runParametersTest(req)
|
|
|
|
def testLocations(self):
|
|
req = DAL.newDataRequest(self.datatype)
|
|
req.addIdentifier("table", self.table)
|
|
|
|
self.runLocationsTest(req)
|
|
|
|
def testTimes(self):
|
|
req = DAL.newDataRequest(self.datatype)
|
|
req.addIdentifier("table", self.table)
|
|
req.setParameters("maxtemp_mon", "min_sea_press")
|
|
|
|
self.runTimesTest(req)
|
|
|
|
def testGeometryData(self):
|
|
req = DAL.newDataRequest(self.datatype)
|
|
req.addIdentifier("table", self.table)
|
|
req.setLocationNames("KFNB")
|
|
req.setParameters("maxtemp_mon", "min_sea_press")
|
|
|
|
self.runGeometryDataTest(req)
|
|
|
|
@classmethod
|
|
def tearDownClass(cls):
|
|
print("CLIMATE TESTS COMPLETE\n\n\n")
|
|
|
|
if __name__ == '__main__':
|
|
dafTestsArgsUtil.parseAndHandleArgs()
|
|
unittest.main(argv=sys.argv[:1])
|