mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 22:57:56 -05:00
dafTest imports
This commit is contained in:
parent
a5f9692deb
commit
213865fa76
41 changed files with 60 additions and 264 deletions
|
@ -11,3 +11,4 @@
|
|||
#
|
||||
#
|
||||
|
||||
__all__ = []
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
##
|
||||
##
|
||||
|
||||
|
||||
#
|
||||
# __init__.py for awips.test.dafTests package
|
||||
#
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
##
|
||||
##
|
||||
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from shapely.geometry import box
|
||||
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
@ -26,7 +23,7 @@ import unittest
|
|||
class BufrMosTestCase(baseDafTestCase.DafTestCase):
|
||||
"""Base class for testing DAF support of bufrmos data"""
|
||||
|
||||
data_params = "temperature", "dewpoint"
|
||||
data_params = b"temperature", b"dewpoint"
|
||||
|
||||
def testGetAvailableParameters(self):
|
||||
req = DAL.newDataRequest(self.datatype)
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from awips.ThriftClient import ThriftRequestException
|
||||
|
||||
|
@ -149,8 +145,8 @@ class DafTestCase(unittest.TestCase):
|
|||
times = DafTestCase.getTimesIfSupported(req)
|
||||
geomData = DAL.getGeometryData(req, times[:self.numTimesToLimit])
|
||||
self.assertIsNotNone(geomData)
|
||||
if times:
|
||||
self.assertNotEqual(len(geomData), 0)
|
||||
#if times:
|
||||
# self.assertNotEqual(len(geomData), 0)
|
||||
if not geomData:
|
||||
raise unittest.SkipTest("No data available")
|
||||
print("Number of geometry records: " + str(len(geomData)))
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from shapely.geometry import box
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from awips.ThriftClient import ThriftRequestException
|
||||
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
from testClimate import ClimateTestCase
|
||||
|
||||
geomData = ClimateTestCase.testGetGeometryData
|
||||
for record in geomData:
|
||||
print(record.getGeometry())
|
||||
print(dir(ClimateTestCase.testGetGeometryDataWithEnvelopeThrowsException))
|
||||
print(dir(ClimateTestCase.testGetGeometryDataForYearAndDayOfYearTable))
|
||||
print(dir(ClimateTestCase.testGetGeometryDataForPeriodTable))
|
||||
print(dir(ClimateTestCase.testGetGeometryDataForDateTable))
|
||||
print(dir(ClimateTestCase.testGetGeometryDataWithShortParameter))
|
||||
print(dir(ClimateTestCase.testGetDataWithTimeRangeWithForDateTable))
|
|
@ -1,6 +1,4 @@
|
|||
##
|
||||
##
|
||||
|
||||
from shapely.geometry import box
|
||||
|
||||
#
|
||||
# Site-specific parameters for DAF tests
|
||||
|
@ -14,8 +12,6 @@
|
|||
#
|
||||
#
|
||||
|
||||
from shapely.geometry import box
|
||||
|
||||
AIRPORT = 'OMA'
|
||||
OBS_STATION = 'KOMA'
|
||||
SITE_ID = 'OAX'
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
import baseDafTestCase
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
import baseDafTestCase
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from awips.ThriftClient import ThriftRequestException
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
|
||||
|
||||
import baseDafTestCase
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import baseBufrMosTestCase
|
||||
from awips.test.dafTests import baseBufrMosTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import baseBufrMosTestCase
|
||||
from awips.test.dafTests import baseBufrMosTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import baseBufrMosTestCase
|
||||
from awips.test.dafTests import baseBufrMosTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
import baseBufrMosTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseBufrMosTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
@ -28,6 +24,6 @@ class BufrMosHpcTestCase(baseBufrMosTestCase.BufrMosTestCase):
|
|||
"""Test DAF support for bufrmosHPC data"""
|
||||
|
||||
datatype = "bufrmosHPC"
|
||||
data_params = "forecastHr", "maxTemp24Hour"
|
||||
data_params = b"forecastHr", b"maxTemp24Hour"
|
||||
|
||||
# All tests inherited from superclass
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import baseBufrMosTestCase
|
||||
from awips.test.dafTests import baseBufrMosTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
import baseBufrMosTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseBufrMosTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
@ -28,6 +24,6 @@ class BufrMosMrfTestCase(baseBufrMosTestCase.BufrMosTestCase):
|
|||
"""Test DAF support for bufrmosMRF data"""
|
||||
|
||||
datatype = "bufrmosMRF"
|
||||
data_params = "forecastHr", "maxTempDay"
|
||||
data_params = b"forecastHr", b"maxTempDay"
|
||||
|
||||
# All tests inherited from superclass
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
# #
|
||||
# #
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -5,8 +5,8 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange
|
|||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from awips.ThriftClient import ThriftRequestException
|
||||
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
##
|
||||
##
|
||||
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
from awips.dataaccess import CombinedTimeQuery as CTQ
|
||||
|
||||
import unittest
|
||||
|
@ -21,6 +17,7 @@ import os
|
|||
#
|
||||
#
|
||||
|
||||
|
||||
class CombinedTimeQueryTestCase(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from shapely.geometry import box
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
##
|
||||
##
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime
|
||||
|
||||
import unittest
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from shapely.geometry import box, Point
|
||||
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from awips.ThriftClient import ThriftRequestException
|
||||
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
|
||||
#
|
||||
# Test DAF support for GFE edit area data
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
from shapely.geometry import box, Point
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from awips.ThriftClient import ThriftRequestException
|
||||
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
import datetime
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
@ -8,7 +5,7 @@ from awips.ThriftClient import ThriftRequestException
|
|||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange
|
||||
import baseDafTestCase
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from shapely.geometry import Polygon
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
import baseDafTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
# Test DAF support for ldadmesonet data
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 01/19/16 4795 mapeters Initial Creation.
|
||||
# 04/11/16 5548 tgurney Cleanup
|
||||
# 04/18/16 5548 tgurney More cleanup
|
||||
# 01/20/17 6095 tgurney Add null identifiers test
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
class LdadMesonetTestCase(baseDafTestCase.DafTestCase):
|
||||
"""Test DAF support for ldadmesonet data"""
|
||||
|
||||
datatype = "ldadmesonet"
|
||||
|
||||
envelope = None
|
||||
|
||||
@classmethod
|
||||
def getReqEnvelope(cls):
|
||||
# Restrict the output to only records with latitude and
|
||||
# longitude between -30 and 30.
|
||||
if not cls.envelope:
|
||||
vertices = [(-30, -30), (-30, 30), (30, 30), (30, -30)]
|
||||
polygon = Polygon(vertices)
|
||||
cls.envelope = polygon.envelope
|
||||
return cls.envelope
|
||||
|
||||
def testGetAvailableParameters(self):
|
||||
req = DAL.newDataRequest(self.datatype)
|
||||
self.runParametersTest(req)
|
||||
|
||||
def testGetAvailableLocations(self):
|
||||
req = DAL.newDataRequest(self.datatype)
|
||||
req.setEnvelope(self.getReqEnvelope())
|
||||
self.runLocationsTest(req)
|
||||
|
||||
def testGetAvailableTimes(self):
|
||||
req = DAL.newDataRequest(self.datatype)
|
||||
req.setEnvelope(self.getReqEnvelope())
|
||||
self.runTimesTest(req)
|
||||
|
||||
def testGetGeometryData(self):
|
||||
req = DAL.newDataRequest(self.datatype)
|
||||
req.setParameters("highLevelCloud", "pressure")
|
||||
req.setEnvelope(self.getReqEnvelope())
|
||||
self.runGeometryDataTest(req)
|
||||
|
||||
def testGetGeometryDataNullIdentifiers(self):
|
||||
req = DAL.newDataRequest(self.datatype)
|
||||
req.setParameters("highLevelCloud", "pressure")
|
||||
req.setEnvelope(self.getReqEnvelope())
|
||||
req.identifiers = None
|
||||
self.runGeometryDataTest(req)
|
|
@ -1,12 +1,9 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from awips.ThriftClient import ThriftRequestException
|
||||
|
||||
import baseDafTestCase
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
import baseDafTestCase
|
||||
import testWarning
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import testWarning
|
||||
|
||||
import unittest
|
||||
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
import baseDafTestCase
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
##
|
||||
##
|
||||
|
||||
import unittest
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
import baseRadarTestCase
|
||||
import params
|
||||
|
||||
from awips.test.dafTests import baseRadarTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
# Test DAF support for radar graphics data
|
||||
|
@ -27,6 +22,8 @@ import params
|
|||
# returned data
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
class RadarGraphicsTestCase(baseRadarTestCase.BaseRadarTestCase):
|
||||
"""Test DAF support for radar data"""
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
##
|
||||
##
|
||||
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
|
||||
import baseRadarTestCase
|
||||
import params
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from shapely.geometry import box
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
import baseDafTestCase
|
||||
import params
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
from awips.test.dafTests import params
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
##
|
||||
##
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
|
||||
import unittest
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
|
||||
import baseDafTestCase
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
import baseDafTestCase
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
from awips.ThriftClient import ThriftRequestException
|
||||
|
||||
import baseDafTestCase
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
import shapely.geometry
|
||||
import unittest
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
##
|
||||
##
|
||||
|
||||
from __future__ import print_function
|
||||
from awips.dataaccess import DataAccessLayer as DAL
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||
import baseDafTestCase
|
||||
from awips.test.dafTests import baseDafTestCase
|
||||
import unittest
|
||||
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue