mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 22:57:56 -05:00
code cleanup for dafTests
This commit is contained in:
parent
e20bf91a32
commit
8f193191f8
30 changed files with 157 additions and 271 deletions
|
@ -1,11 +1,3 @@
|
||||||
#
|
|
||||||
# SOFTWARE HISTORY
|
|
||||||
#
|
|
||||||
# Date Ticket# Engineer Description
|
|
||||||
# ------------ ---------- ----------- --------------------------
|
|
||||||
# 11/03/10 5849 cjeanbap Initial Creation.
|
|
||||||
#
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,2 @@
|
||||||
#
|
|
||||||
# __init__.py for awips.test.dafTests package
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# SOFTWARE HISTORY
|
|
||||||
#
|
|
||||||
# Date Ticket# Engineer Description
|
|
||||||
# ------------ ---------- ----------- --------------------------
|
|
||||||
# 02/09/2016 4795 mapeters Initial creation.
|
|
||||||
# 04/12/2016 5548 tgurney Cleanup
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
__all__ = []
|
__all__ = []
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
from awips.test.dafTests import baseDafTestCase
|
||||||
from awips.test.dafTests import params
|
from awips.test.dafTests import params
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
from awips.ThriftClient import ThriftRequestException
|
|
||||||
|
|
||||||
import os
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Base TestCase for DAF tests. This class provides helper methods and
|
# Base TestCase for DAF tests. This class provides helper methods and
|
||||||
# tests common to all DAF test cases.
|
# tests common to all DAF test cases.
|
||||||
|
@ -34,6 +27,13 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from awips.ThriftClient import ThriftRequestException
|
||||||
|
|
||||||
|
import os
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class DafTestCase(unittest.TestCase):
|
class DafTestCase(unittest.TestCase):
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class DafTestCase(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
times = DAL.getAvailableTimes(req)
|
times = DAL.getAvailableTimes(req)
|
||||||
except ThriftRequestException as e:
|
except ThriftRequestException as e:
|
||||||
if not 'TimeAgnosticDataException' in str(e):
|
if 'TimeAgnosticDataException' not in str(e):
|
||||||
raise
|
raise
|
||||||
return times
|
return times
|
||||||
|
|
||||||
|
@ -98,14 +98,14 @@ class DafTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def runInvalidIdValuesTest(self):
|
def runInvalidIdValuesTest(self):
|
||||||
badString = 'id from ' + self.datatype + '; select 1;'
|
badString = 'id from ' + self.datatype + '; select 1;'
|
||||||
with self.assertRaises(ThriftRequestException) as cm:
|
with self.assertRaises(ThriftRequestException):
|
||||||
req = DAL.newDataRequest(self.datatype)
|
req = DAL.newDataRequest(self.datatype)
|
||||||
idValues = DAL.getIdentifierValues(req, badString)
|
DAL.getIdentifierValues(req, badString)
|
||||||
|
|
||||||
def runNonexistentIdValuesTest(self):
|
def runNonexistentIdValuesTest(self):
|
||||||
with self.assertRaises(ThriftRequestException) as cm:
|
with self.assertRaises(ThriftRequestException):
|
||||||
req = DAL.newDataRequest(self.datatype)
|
req = DAL.newDataRequest(self.datatype)
|
||||||
idValues = DAL.getIdentifierValues(req, 'idthatdoesnotexist')
|
DAL.getIdentifierValues(req, 'idthatdoesnotexist')
|
||||||
|
|
||||||
def runParametersTest(self, req):
|
def runParametersTest(self, req):
|
||||||
params = DAL.getAvailableParameters(req)
|
params = DAL.getAvailableParameters(req)
|
||||||
|
@ -134,7 +134,7 @@ class DafTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def runTimeAgnosticTest(self, req):
|
def runTimeAgnosticTest(self, req):
|
||||||
with self.assertRaises(ThriftRequestException) as cm:
|
with self.assertRaises(ThriftRequestException) as cm:
|
||||||
times = DAL.getAvailableTimes(req)
|
DAL.getAvailableTimes(req)
|
||||||
self.assertIn('TimeAgnosticDataException', str(cm.exception))
|
self.assertIn('TimeAgnosticDataException', str(cm.exception))
|
||||||
|
|
||||||
def runGeometryDataTest(self, req, checkDataTimes=True):
|
def runGeometryDataTest(self, req, checkDataTimes=True):
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
from awips.ThriftClient import ThriftRequestException
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
from awips.test.dafTests import params
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Tests common to all radar factories
|
# Tests common to all radar factories
|
||||||
#
|
#
|
||||||
|
@ -30,6 +23,13 @@ from awips.test.dafTests import params
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from awips.ThriftClient import ThriftRequestException
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
from awips.test.dafTests import params
|
||||||
|
|
||||||
|
|
||||||
class BaseRadarTestCase(baseDafTestCase.DafTestCase):
|
class BaseRadarTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Tests common to all radar factories"""
|
"""Tests common to all radar factories"""
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
from shapely.geometry import box
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Site-specific parameters for DAF tests
|
# Site-specific parameters for DAF tests
|
||||||
#
|
#
|
||||||
|
@ -12,6 +10,9 @@ from shapely.geometry import box
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from shapely.geometry import box
|
||||||
|
|
||||||
|
|
||||||
AIRPORT = 'OMA'
|
AIRPORT = 'OMA'
|
||||||
OBS_STATION = 'KOMA'
|
OBS_STATION = 'KOMA'
|
||||||
SITE_ID = 'OAX'
|
SITE_ID = 'OAX'
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for ACARS data
|
# Test DAF support for ACARS data
|
||||||
#
|
#
|
||||||
|
@ -17,6 +11,10 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
|
||||||
|
|
||||||
class AcarsTestCase(baseDafTestCase.DafTestCase):
|
class AcarsTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for ACARS data"""
|
"""Test DAF support for ACARS data"""
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
|
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for airep data
|
# Test DAF support for airep data
|
||||||
#
|
#
|
||||||
|
@ -20,6 +14,12 @@ from awips.test.dafTests import baseDafTestCase
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
|
||||||
|
|
||||||
class AirepTestCase(baseDafTestCase.DafTestCase):
|
class AirepTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for airep data"""
|
"""Test DAF support for airep data"""
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
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
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for binlightning data
|
# Test DAF support for binlightning data
|
||||||
#
|
#
|
||||||
|
@ -27,6 +20,11 @@ from awips.test.dafTests import baseDafTestCase
|
||||||
# 11/08/16 5985 tgurney Do not check data times
|
# 11/08/16 5985 tgurney Do not check data times
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
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
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
|
||||||
|
|
||||||
class BinLightningTestCase(baseDafTestCase.DafTestCase):
|
class BinLightningTestCase(baseDafTestCase.DafTestCase):
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
from awips.test.dafTests import baseBufrMosTestCase
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for bufrmosGFS data
|
# Test DAF support for bufrmosGFS data
|
||||||
#
|
#
|
||||||
|
@ -14,6 +11,8 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseBufrMosTestCase
|
||||||
|
|
||||||
|
|
||||||
class BufrMosGfsTestCase(baseBufrMosTestCase.BufrMosTestCase):
|
class BufrMosGfsTestCase(baseBufrMosTestCase.BufrMosTestCase):
|
||||||
"""Test DAF support for bufrmosGFS data"""
|
"""Test DAF support for bufrmosGFS data"""
|
||||||
|
|
|
@ -4,7 +4,6 @@ from awips.dataaccess import DataAccessLayer as DAL
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
from awips.test.dafTests import baseDafTestCase
|
from awips.test.dafTests import baseDafTestCase
|
||||||
from awips.test.dafTests import params
|
from awips.test.dafTests import params
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for bufrua data
|
# Test DAF support for bufrua data
|
||||||
|
|
|
@ -1,14 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
import datetime
|
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
from awips.ThriftClient import ThriftRequestException
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
from awips.test.dafTests import params
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for climate data
|
# Test DAF support for climate data
|
||||||
#
|
#
|
||||||
|
@ -31,6 +20,17 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
import datetime
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from awips.ThriftClient import ThriftRequestException
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
from awips.test.dafTests import params
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class ClimateTestCase(baseDafTestCase.DafTestCase):
|
class ClimateTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for climate data"""
|
"""Test DAF support for climate data"""
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
from awips.dataaccess import CombinedTimeQuery as CTQ
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
import os
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test the CombinedTimedQuery module
|
# Test the CombinedTimedQuery module
|
||||||
#
|
#
|
||||||
|
@ -17,6 +11,12 @@ import os
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from awips.dataaccess import CombinedTimeQuery as CTQ
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
class CombinedTimeQueryTestCase(unittest.TestCase):
|
class CombinedTimeQueryTestCase(unittest.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
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
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
from awips.test.dafTests import params
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for common_obs_spatial data
|
# Test DAF support for common_obs_spatial data
|
||||||
#
|
#
|
||||||
|
@ -27,6 +18,12 @@ import unittest
|
||||||
# 01/06/17 5981 tgurney Do not check data times
|
# 01/06/17 5981 tgurney Do not check data times
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
from awips.test.dafTests import params
|
||||||
|
|
||||||
|
|
||||||
class CommonObsSpatialTestCase(baseDafTestCase.DafTestCase):
|
class CommonObsSpatialTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for common_obs_spatial data"""
|
"""Test DAF support for common_obs_spatial data"""
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Unit tests for Python implementation of RequestConstraint
|
# Unit tests for Python implementation of RequestConstraint
|
||||||
#
|
#
|
||||||
|
@ -13,6 +9,10 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class DataTimeTestCase(unittest.TestCase):
|
class DataTimeTestCase(unittest.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
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
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
from awips.test.dafTests import params
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for GFE data
|
# Test DAF support for GFE data
|
||||||
#
|
#
|
||||||
|
@ -32,6 +23,15 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
from awips.test.dafTests import params
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class GfeTestCase(baseDafTestCase.DafTestCase):
|
class GfeTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for GFE data"""
|
"""Test DAF support for GFE data"""
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
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
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
from awips.test.dafTests import params
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for grid data
|
# Test DAF support for grid data
|
||||||
#
|
#
|
||||||
|
@ -30,6 +20,16 @@ import unittest
|
||||||
# data is available
|
# data is available
|
||||||
#
|
#
|
||||||
|
|
||||||
|
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
|
||||||
|
from shapely.geometry import box, Point
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
from awips.test.dafTests import params
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class GridTestCase(baseDafTestCase.DafTestCase):
|
class GridTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for grid data"""
|
"""Test DAF support for grid data"""
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
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
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for maps data
|
# Test DAF support for maps data
|
||||||
#
|
#
|
||||||
|
@ -24,6 +16,13 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
|
||||||
|
|
||||||
class MapsTestCase(baseDafTestCase.DafTestCase):
|
class MapsTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for maps data"""
|
"""Test DAF support for maps data"""
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
from awips.test.dafTests import params
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for modelsounding data
|
# Test DAF support for modelsounding data
|
||||||
#
|
#
|
||||||
|
@ -27,6 +19,13 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
from awips.test.dafTests import params
|
||||||
|
|
||||||
|
|
||||||
class ModelSoundingTestCase(baseDafTestCase.DafTestCase):
|
class ModelSoundingTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for modelsounding data"""
|
"""Test DAF support for modelsounding data"""
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
from awips.test.dafTests import params
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for obs data
|
# Test DAF support for obs data
|
||||||
#
|
#
|
||||||
|
@ -23,6 +16,13 @@ from awips.test.dafTests import params
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
from awips.test.dafTests import params
|
||||||
|
|
||||||
|
|
||||||
class ObsTestCase(baseDafTestCase.DafTestCase):
|
class ObsTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for obs data"""
|
"""Test DAF support for obs data"""
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for profiler data
|
# Test DAF support for profiler data
|
||||||
#
|
#
|
||||||
|
@ -17,6 +11,11 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
|
||||||
|
|
||||||
class ProfilerTestCase(baseDafTestCase.DafTestCase):
|
class ProfilerTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for profiler data"""
|
"""Test DAF support for profiler data"""
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseRadarTestCase
|
|
||||||
from awips.test.dafTests import params
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for radar graphics data
|
# Test DAF support for radar graphics data
|
||||||
#
|
#
|
||||||
|
@ -22,6 +16,12 @@ from awips.test.dafTests import params
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseRadarTestCase
|
||||||
|
from awips.test.dafTests import params
|
||||||
|
|
||||||
|
|
||||||
class RadarGraphicsTestCase(baseRadarTestCase.BaseRadarTestCase):
|
class RadarGraphicsTestCase(baseRadarTestCase.BaseRadarTestCase):
|
||||||
"""Test DAF support for radar data"""
|
"""Test DAF support for radar data"""
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseRadarTestCase
|
|
||||||
from awips.test.dafTests import params
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for radar grid data
|
# Test DAF support for radar grid data
|
||||||
#
|
#
|
||||||
|
@ -15,6 +9,12 @@ from awips.test.dafTests import params
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseRadarTestCase
|
||||||
|
from awips.test.dafTests import params
|
||||||
|
|
||||||
|
|
||||||
class RadarTestCase(baseRadarTestCase.BaseRadarTestCase):
|
class RadarTestCase(baseRadarTestCase.BaseRadarTestCase):
|
||||||
"""Test DAF support for radar data"""
|
"""Test DAF support for radar data"""
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
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
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
from awips.test.dafTests import params
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for radar_spatial data
|
# Test DAF support for radar_spatial data
|
||||||
#
|
#
|
||||||
|
@ -27,6 +18,13 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
from awips.test.dafTests import params
|
||||||
|
|
||||||
|
|
||||||
class RadarSpatialTestCase(baseDafTestCase.DafTestCase):
|
class RadarSpatialTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for radar_spatial data"""
|
"""Test DAF support for radar_spatial data"""
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Unit tests for Python implementation of RequestConstraint
|
# Unit tests for Python implementation of RequestConstraint
|
||||||
#
|
#
|
||||||
|
@ -13,6 +9,10 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class RequestConstraintTestCase(unittest.TestCase):
|
class RequestConstraintTestCase(unittest.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
|
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for sfcobs data
|
# Test DAF support for sfcobs data
|
||||||
#
|
#
|
||||||
|
@ -21,6 +15,12 @@ from awips.test.dafTests import baseDafTestCase
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
|
||||||
|
|
||||||
class SfcObsTestCase(baseDafTestCase.DafTestCase):
|
class SfcObsTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for sfcobs data"""
|
"""Test DAF support for sfcobs data"""
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
from awips.ThriftClient import ThriftRequestException
|
|
||||||
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
import shapely.geometry
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for topo data
|
# Test DAF support for topo data
|
||||||
#
|
#
|
||||||
|
@ -22,6 +14,13 @@ import unittest
|
||||||
# 07/18/17 6253 randerso Removed referenced to GMTED
|
# 07/18/17 6253 randerso Removed referenced to GMTED
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from awips.ThriftClient import ThriftRequestException
|
||||||
|
import shapely.geometry
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
|
||||||
|
|
||||||
class TopoTestCase(baseDafTestCase.DafTestCase):
|
class TopoTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for topo data"""
|
"""Test DAF support for topo data"""
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
from __future__ import print_function
|
|
||||||
from awips.dataaccess import DataAccessLayer as DAL
|
|
||||||
|
|
||||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
|
||||||
from awips.test.dafTests import baseDafTestCase
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test DAF support for warning data
|
# Test DAF support for warning data
|
||||||
#
|
#
|
||||||
|
@ -26,6 +19,13 @@ import unittest
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from awips.dataaccess import DataAccessLayer as DAL
|
||||||
|
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
|
||||||
|
|
||||||
|
from awips.test.dafTests import baseDafTestCase
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class WarningTestCase(baseDafTestCase.DafTestCase):
|
class WarningTestCase(baseDafTestCase.DafTestCase):
|
||||||
"""Test DAF support for warning data"""
|
"""Test DAF support for warning data"""
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
#
|
|
||||||
# SOFTWARE HISTORY
|
|
||||||
#
|
|
||||||
# Date Ticket# Engineer Description
|
|
||||||
# ------------ ---------- ----------- --------------------------
|
|
||||||
# 03/09/11 njensen Initial Creation.
|
|
||||||
# 08/15/13 2169 bkowal Decompress data read from the queue
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
import time, sys
|
|
||||||
import threading
|
|
||||||
|
|
||||||
import dynamicserialize
|
|
||||||
from io import open
|
|
||||||
|
|
||||||
TIME_TO_SLEEP = 300
|
|
||||||
|
|
||||||
|
|
||||||
class ListenThread(threading.Thread):
|
|
||||||
|
|
||||||
def __init__(self, hostname, portNumber, topicName):
|
|
||||||
self.hostname = hostname
|
|
||||||
self.portNumber = portNumber
|
|
||||||
self.topicName = topicName
|
|
||||||
self.nMessagesReceived = 0
|
|
||||||
self.waitSecond = 0
|
|
||||||
self.stopped = False
|
|
||||||
threading.Thread.__init__(self)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
from awips import QpidSubscriber
|
|
||||||
self.qs = QpidSubscriber.QpidSubscriber(self.hostname, self.portNumber, True)
|
|
||||||
self.qs.topicSubscribe(self.topicName, self.receivedMessage)
|
|
||||||
|
|
||||||
def receivedMessage(self, msg):
|
|
||||||
print("Received message")
|
|
||||||
self.nMessagesReceived += 1
|
|
||||||
if self.waitSecond == 0:
|
|
||||||
fmsg = open('/tmp/rawMessage', 'w')
|
|
||||||
fmsg.write(msg)
|
|
||||||
fmsg.close()
|
|
||||||
|
|
||||||
while self.waitSecond < TIME_TO_SLEEP and not self.stopped:
|
|
||||||
if self.waitSecond % 60 == 0:
|
|
||||||
print(time.strftime('%H:%M:%S'), "Sleeping and stuck in not so infinite while loop")
|
|
||||||
self.waitSecond += 1
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
print(time.strftime('%H:%M:%S'), "Received", self.nMessagesReceived, "messages")
|
|
||||||
|
|
||||||
def stop(self):
|
|
||||||
print("Stopping")
|
|
||||||
self.stopped = True
|
|
||||||
self.qs.close()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
print("Starting up at", time.strftime('%H:%M:%S'))
|
|
||||||
|
|
||||||
topic = 'edex.alerts'
|
|
||||||
host = 'localhost'
|
|
||||||
port = 5672
|
|
||||||
|
|
||||||
thread = ListenThread(host, port, topic)
|
|
||||||
try:
|
|
||||||
thread.start()
|
|
||||||
while True:
|
|
||||||
time.sleep(3)
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
pass
|
|
||||||
finally:
|
|
||||||
thread.stop()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue