Exemplo n.º 1
0
def test_check_asset_in_db():
    from qsmdb.queries import check_asset_query
    from qsmdb.db_io import execute_query
    test_query = check_asset_query('DBK.DE', data_vendor_id=20)
    output = execute_query(test_query, user, password, host, port, database)
    print(type(output['exists'][0]))
    print(output['exists'][0])
    assert output['exists'][0] == True
Exemplo n.º 2
0
def test_check_asset_industry():
    from qsmdb.queries import get_asset_industry
    from qsmdb.db_io import execute_query
    test_query = get_asset_industry('DBK.DE', 20)
    output = execute_query(test_query, user, password, host, port, database)
    print(type(output['industry'][0]))
    print(output['industry'][0])
    # assert len(output['type']) > 0
    assert isinstance(output['industry'][0], str)
Exemplo n.º 3
0
def test_pull_fundamentals_part1():
    from qsmdb.db_io import execute_query
    from qsmdb.config import available_fundamentals
    from numpy import nan
    cat = available_fundamentals['equity']['stock'][test_category]
    cat_query = cat(tsid, beg_date, end_date, data_vendor_id)
    df = execute_query(cat_query, user, password, host, port, database)
    df.fillna(value=nan, inplace=True)
    assert len(df) > 0