예제 #1
0
def test_dp_dstream_list():
    provider = DatastreamProvider()
    series = [ x.rstrip() for x in open('dstream.req').readlines()]
    for s in series:
        provider.append(s)
    res = provider.request()
    pprint(res)
예제 #2
0
def test_dp_stdfunc_01():
    provider = DatastreamProvider()
#    provider.setUp({'IO':'cover'})

    from StringIO import StringIO
    F = """
dstream://Datastream/%ISO2(ITA)WOPPPSR?name=W_ITA
"""
    for l in StringIO(F).readlines():
        provider.append(l)
   
    pprint(provider._func)

    res = provider.request()

    assert False
예제 #3
0
def test_dp_ds_options():
    provider = DatastreamProvider()
    
    from StringIO import StringIO
    F = """
option://param/BASEYEAR?2010
option://param/ATSRANGE?start=2000001&end=2000012
option://param/TSRANGE?start=2009001&end=2011012
option://param/D_TSRANGE_AVG?~2005-12-31~2005-01-01~M
option://param/D_TSRANGE?~2011-12-31~2009-01-01~M
option://param/AVG?proc=convert(freq=A,func=mean)|oper(div=100)
option://func/p_w_avg(B,Y)?proc=convert(freq=M,func=mean)|weighted_avg(base=$B)|deltap|limitY(year=$Y,n=2)|drop($B)

"""
    for l in StringIO(F).readlines():
        provider.append(l)

    res = provider.request()

    print "SERIES",res.keys()
    for k,r in res.items():
        print k
        r.report()
    assert False
예제 #4
0
def test_dp_dstream_simple_request():
    provider = DatastreamProvider()
    provider.append('dstream://Datastream/ESVACTOTP')
    res = provider.request()
    pprint(res)