##// END OF EJS Templates
Some WIP refactoring, trying to remove TimeController object...
Some WIP refactoring, trying to remove TimeController object SciQLOP core should be usable OOTB without creating controllers objects. Time range should be given on variable creation not taken from a global object. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1341:f18e017310bc
r1345:ce477e992869
Show More
TestAmdaDownload.py
38 lines | 1.2 KiB | text/x-python | PythonLexer
/ plugins / amda / tests / TestAmdaDownload.py
Added basic tests around Amda plugin Python wrapper...
r1340 import sys
import os
if not hasattr(sys, 'argv'):
sys.argv = ['']
current_script_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(current_script_path)
import pytestamda
Some refactoring on PB11 wrappers...
r1341 import pysciqlopcore
import amda
Added basic tests around Amda plugin Python wrapper...
r1340
import numpy as np
import datetime
import time
import unittest
import ddt
@ddt.ddt
class FunctionalTests(unittest.TestCase):
def setUp(self):
pass
@ddt.data(
(datetime.datetime(2012,10,20,8,10,00),datetime.datetime(2012,10,20,12,0,0)),
(datetime.datetime(2025,1,1,15,0,0),datetime.datetime(2025,1,1,16,0,0)),
(datetime.datetime(2000,1,1,0,0,0),datetime.datetime(2000,1,1,12,0,0))
)
def test_simple_download(self, case):
tstart = case[0]
tstop = case[1]
Some refactoring on PB11 wrappers...
r1341 pytestamda.TimeController.setTime(pysciqlopcore.SqpRange(tstart, tstop))
Added basic tests around Amda plugin Python wrapper...
r1340 variable = pytestamda.VariableController.createVariable("bx_gse",pytestamda.amda_provider())
Some refactoring on PB11 wrappers...
r1341 pytestamda.VariableController.wait_for_downloads()
Added basic tests around Amda plugin Python wrapper...
r1340 t_ref, x_ref, y_ref, z_ref = amda.generate_data(np.datetime64(tstart), np.datetime64(tstop), 4)
Some refactoring on PB11 wrappers...
r1341 self.assertTrue( amda.compare_with_ref(variable,(t_ref, x_ref, y_ref, z_ref) ) )
Added basic tests around Amda plugin Python wrapper...
r1340
if __name__ == '__main__':
unittest.main(exit=False)