Example #1
0
def test_get_first_page_of_companies_data():
    companies = get_page('companies')
    assert isinstance(companies, pd.DataFrame)
    assert len(companies) == get_page_size('companies')
    assert companies.total_pages > 1
    assert 'ticker' in companies.columns
    assert 'cik' in companies.columns
    assert 'lei' in companies.columns
    assert 'name' in companies.columns
Example #2
0
def test_get_page_size_with_undefined_endpoint():
    page_size = get_page_size('not-defined')
    assert page_size == 250
Example #3
0
def test_get_page_size_with_defined_endpoint():
    page_size = get_page_size('prices')
    assert page_size == 50000
Example #4
0
def test_get_companies_data_with_query_that_returns_many_pages():
    companies = get('companies', query='Corp')
    assert len(companies) > get_page_size('companies')
    assert len(companies) > 300
    assert companies.name.str.contains('Corp').any()