diff --git a/awips/test/Record.py b/awips/test/Record.py index 4e0b214..c9eac48 100644 --- a/awips/test/Record.py +++ b/awips/test/Record.py @@ -1,11 +1,3 @@ -# -# SOFTWARE HISTORY -# -# Date Ticket# Engineer Description -# ------------ ---------- ----------- -------------------------- -# 11/03/10 5849 cjeanbap Initial Creation. -# - import sys diff --git a/awips/test/dafTests/__init__.py b/awips/test/dafTests/__init__.py index 5a131f0..b5757f8 100644 --- a/awips/test/dafTests/__init__.py +++ b/awips/test/dafTests/__init__.py @@ -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__ = [] diff --git a/awips/test/dafTests/baseBufrMosTestCase.py b/awips/test/dafTests/baseBufrMosTestCase.py index e55256e..ac18a40 100644 --- a/awips/test/dafTests/baseBufrMosTestCase.py +++ b/awips/test/dafTests/baseBufrMosTestCase.py @@ -13,6 +13,7 @@ # from awips.dataaccess import DataAccessLayer as DAL + from awips.test.dafTests import baseDafTestCase from awips.test.dafTests import params diff --git a/awips/test/dafTests/baseDafTestCase.py b/awips/test/dafTests/baseDafTestCase.py index 066d03b..0a78fff 100644 --- a/awips/test/dafTests/baseDafTestCase.py +++ b/awips/test/dafTests/baseDafTestCase.py @@ -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 # 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): @@ -68,7 +68,7 @@ class DafTestCase(unittest.TestCase): try: times = DAL.getAvailableTimes(req) except ThriftRequestException as e: - if not 'TimeAgnosticDataException' in str(e): + if 'TimeAgnosticDataException' not in str(e): raise return times @@ -98,14 +98,14 @@ class DafTestCase(unittest.TestCase): def runInvalidIdValuesTest(self): badString = 'id from ' + self.datatype + '; select 1;' - with self.assertRaises(ThriftRequestException) as cm: + with self.assertRaises(ThriftRequestException): req = DAL.newDataRequest(self.datatype) - idValues = DAL.getIdentifierValues(req, badString) + DAL.getIdentifierValues(req, badString) def runNonexistentIdValuesTest(self): - with self.assertRaises(ThriftRequestException) as cm: + with self.assertRaises(ThriftRequestException): req = DAL.newDataRequest(self.datatype) - idValues = DAL.getIdentifierValues(req, 'idthatdoesnotexist') + DAL.getIdentifierValues(req, 'idthatdoesnotexist') def runParametersTest(self, req): params = DAL.getAvailableParameters(req) @@ -134,7 +134,7 @@ class DafTestCase(unittest.TestCase): def runTimeAgnosticTest(self, req): with self.assertRaises(ThriftRequestException) as cm: - times = DAL.getAvailableTimes(req) + DAL.getAvailableTimes(req) self.assertIn('TimeAgnosticDataException', str(cm.exception)) def runGeometryDataTest(self, req, checkDataTimes=True): diff --git a/awips/test/dafTests/baseRadarTestCase.py b/awips/test/dafTests/baseRadarTestCase.py index 1a1a236..e312d56 100644 --- a/awips/test/dafTests/baseRadarTestCase.py +++ b/awips/test/dafTests/baseRadarTestCase.py @@ -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 # @@ -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): """Tests common to all radar factories""" diff --git a/awips/test/dafTests/params.py b/awips/test/dafTests/params.py index df4e594..09b91c5 100644 --- a/awips/test/dafTests/params.py +++ b/awips/test/dafTests/params.py @@ -1,5 +1,3 @@ -from shapely.geometry import box - # # Site-specific parameters for DAF tests # @@ -12,6 +10,9 @@ from shapely.geometry import box # # +from shapely.geometry import box + + AIRPORT = 'OMA' OBS_STATION = 'KOMA' SITE_ID = 'OAX' diff --git a/awips/test/dafTests/testAcars.py b/awips/test/dafTests/testAcars.py index 255e367..2a2b54f 100644 --- a/awips/test/dafTests/testAcars.py +++ b/awips/test/dafTests/testAcars.py @@ -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 # @@ -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): """Test DAF support for ACARS data""" diff --git a/awips/test/dafTests/testAirep.py b/awips/test/dafTests/testAirep.py index 5e0ff71..2ca75d0 100644 --- a/awips/test/dafTests/testAirep.py +++ b/awips/test/dafTests/testAirep.py @@ -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 # @@ -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): """Test DAF support for airep data""" diff --git a/awips/test/dafTests/testBinLightning.py b/awips/test/dafTests/testBinLightning.py index e74dfd0..f9952c3 100644 --- a/awips/test/dafTests/testBinLightning.py +++ b/awips/test/dafTests/testBinLightning.py @@ -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 # @@ -27,6 +20,11 @@ from awips.test.dafTests import baseDafTestCase # 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): diff --git a/awips/test/dafTests/testBufrMosGfs.py b/awips/test/dafTests/testBufrMosGfs.py index efa7499..886f4d4 100644 --- a/awips/test/dafTests/testBufrMosGfs.py +++ b/awips/test/dafTests/testBufrMosGfs.py @@ -1,6 +1,3 @@ -from awips.test.dafTests import baseBufrMosTestCase -import unittest - # # Test DAF support for bufrmosGFS data # @@ -14,6 +11,8 @@ import unittest # # +from awips.test.dafTests import baseBufrMosTestCase + class BufrMosGfsTestCase(baseBufrMosTestCase.BufrMosTestCase): """Test DAF support for bufrmosGFS data""" diff --git a/awips/test/dafTests/testBufrUa.py b/awips/test/dafTests/testBufrUa.py index 5c3f6ff..6f51290 100644 --- a/awips/test/dafTests/testBufrUa.py +++ b/awips/test/dafTests/testBufrUa.py @@ -4,7 +4,6 @@ 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 bufrua data diff --git a/awips/test/dafTests/testClimate.py b/awips/test/dafTests/testClimate.py index 09c4b63..794eb80 100644 --- a/awips/test/dafTests/testClimate.py +++ b/awips/test/dafTests/testClimate.py @@ -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 # @@ -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): """Test DAF support for climate data""" diff --git a/awips/test/dafTests/testCombinedTimeQuery.py b/awips/test/dafTests/testCombinedTimeQuery.py index 7baa337..8526c9c 100644 --- a/awips/test/dafTests/testCombinedTimeQuery.py +++ b/awips/test/dafTests/testCombinedTimeQuery.py @@ -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 # @@ -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): diff --git a/awips/test/dafTests/testCommonObsSpatial.py b/awips/test/dafTests/testCommonObsSpatial.py index 67dd1f7..169a00e 100644 --- a/awips/test/dafTests/testCommonObsSpatial.py +++ b/awips/test/dafTests/testCommonObsSpatial.py @@ -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 # @@ -27,6 +18,12 @@ import unittest # 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): """Test DAF support for common_obs_spatial data""" diff --git a/awips/test/dafTests/testDataTime.py b/awips/test/dafTests/testDataTime.py index a364de7..d543703 100644 --- a/awips/test/dafTests/testDataTime.py +++ b/awips/test/dafTests/testDataTime.py @@ -1,7 +1,3 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime - -import unittest - # # 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): diff --git a/awips/test/dafTests/testGfe.py b/awips/test/dafTests/testGfe.py index 6d0e554..41da163 100644 --- a/awips/test/dafTests/testGfe.py +++ b/awips/test/dafTests/testGfe.py @@ -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 # @@ -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): """Test DAF support for GFE data""" diff --git a/awips/test/dafTests/testGrid.py b/awips/test/dafTests/testGrid.py index 56d00de..7ed464d 100644 --- a/awips/test/dafTests/testGrid.py +++ b/awips/test/dafTests/testGrid.py @@ -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 # @@ -30,6 +20,16 @@ import unittest # 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): """Test DAF support for grid data""" diff --git a/awips/test/dafTests/testMaps.py b/awips/test/dafTests/testMaps.py index bf4bcf9..48e290e 100644 --- a/awips/test/dafTests/testMaps.py +++ b/awips/test/dafTests/testMaps.py @@ -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 # @@ -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): """Test DAF support for maps data""" diff --git a/awips/test/dafTests/testModelSounding.py b/awips/test/dafTests/testModelSounding.py index c71cb10..618203e 100644 --- a/awips/test/dafTests/testModelSounding.py +++ b/awips/test/dafTests/testModelSounding.py @@ -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 # @@ -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): """Test DAF support for modelsounding data""" diff --git a/awips/test/dafTests/testObs.py b/awips/test/dafTests/testObs.py index 2fe54d0..0f41e8d 100644 --- a/awips/test/dafTests/testObs.py +++ b/awips/test/dafTests/testObs.py @@ -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 # @@ -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): """Test DAF support for obs data""" diff --git a/awips/test/dafTests/testProfiler.py b/awips/test/dafTests/testProfiler.py index 79fa833..c412c1c 100644 --- a/awips/test/dafTests/testProfiler.py +++ b/awips/test/dafTests/testProfiler.py @@ -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 # @@ -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): """Test DAF support for profiler data""" diff --git a/awips/test/dafTests/testRadarGraphics.py b/awips/test/dafTests/testRadarGraphics.py index 238b1cc..b230bfe 100644 --- a/awips/test/dafTests/testRadarGraphics.py +++ b/awips/test/dafTests/testRadarGraphics.py @@ -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 # @@ -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): """Test DAF support for radar data""" diff --git a/awips/test/dafTests/testRadarGrid.py b/awips/test/dafTests/testRadarGrid.py index 2dce2ff..abcbf85 100644 --- a/awips/test/dafTests/testRadarGrid.py +++ b/awips/test/dafTests/testRadarGrid.py @@ -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 # @@ -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): """Test DAF support for radar data""" diff --git a/awips/test/dafTests/testRadarSpatial.py b/awips/test/dafTests/testRadarSpatial.py index c2511f9..00c68d5 100644 --- a/awips/test/dafTests/testRadarSpatial.py +++ b/awips/test/dafTests/testRadarSpatial.py @@ -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 # @@ -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): """Test DAF support for radar_spatial data""" diff --git a/awips/test/dafTests/testRequestConstraint.py b/awips/test/dafTests/testRequestConstraint.py index cfb2a01..4e90656 100644 --- a/awips/test/dafTests/testRequestConstraint.py +++ b/awips/test/dafTests/testRequestConstraint.py @@ -1,7 +1,3 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint - -import unittest - # # 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): diff --git a/awips/test/dafTests/testSatellite.py b/awips/test/dafTests/testSatellite.py index 79d4b42..089f02d 100644 --- a/awips/test/dafTests/testSatellite.py +++ b/awips/test/dafTests/testSatellite.py @@ -20,6 +20,7 @@ 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 diff --git a/awips/test/dafTests/testSfcObs.py b/awips/test/dafTests/testSfcObs.py index 517e0d2..0db49f8 100644 --- a/awips/test/dafTests/testSfcObs.py +++ b/awips/test/dafTests/testSfcObs.py @@ -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 # @@ -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): """Test DAF support for sfcobs data""" diff --git a/awips/test/dafTests/testTopo.py b/awips/test/dafTests/testTopo.py index ef493e8..1c3a2ed 100644 --- a/awips/test/dafTests/testTopo.py +++ b/awips/test/dafTests/testTopo.py @@ -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 # @@ -22,6 +14,13 @@ import unittest # 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): """Test DAF support for topo data""" diff --git a/awips/test/dafTests/testWarning.py b/awips/test/dafTests/testWarning.py index 76bbe09..de2fa3f 100644 --- a/awips/test/dafTests/testWarning.py +++ b/awips/test/dafTests/testWarning.py @@ -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 # @@ -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): """Test DAF support for warning data""" diff --git a/awips/test/testQpidTimeToLive.py b/awips/test/testQpidTimeToLive.py deleted file mode 100644 index 21db89c..0000000 --- a/awips/test/testQpidTimeToLive.py +++ /dev/null @@ -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() - - -