##// 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
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
import pysciqlopcore
import amda
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]
pytestamda.TimeController.setTime(pysciqlopcore.SqpRange(tstart, tstop))
variable = pytestamda.VariableController.createVariable("bx_gse",pytestamda.amda_provider())
pytestamda.VariableController.wait_for_downloads()
t_ref, x_ref, y_ref, z_ref = amda.generate_data(np.datetime64(tstart), np.datetime64(tstop), 4)
self.assertTrue( amda.compare_with_ref(variable,(t_ref, x_ref, y_ref, z_ref) ) )
if __name__ == '__main__':
unittest.main(exit=False)