Beispiel #1
0
def test_valid_symbol_list_filer(data_regression, quote_lookup_raw_response,
                                 exchange_type, asset_type):
    before = ValidSymbolList(**quote_lookup_raw_response)

    after_filtering = before.filter_symbols(exchange_type=exchange_type,
                                            asset_type=asset_type)

    data_regression.check(after_filtering.json())
Beispiel #2
0
def test_parse_summary_table(data_regression, summary_page_data_fixture):

    symbol, data = summary_page_data_fixture

    result = create_summary_page_object(symbol, data)

    assert result.high > result.low

    data_regression.check(result.json())
Beispiel #3
0
def test_echo(data_regression, case):
    kwargs = case.as_requests_kwargs()
    response = requests.request(**kwargs)
    assert response.status_code == 200
    results = response.content

    function_name = sys._getframe(2).f_code.co_name

    regresion_path = get_regression_path(kwargs, path=function_name)
    results_hash = get_hash_results(results)

    data_regression.check(results_hash, regresion_path)
Beispiel #4
0
def test_valid_symbol_list_object(data_regression, quote_lookup_raw_response):
    results = ValidSymbolList(**quote_lookup_raw_response)
    data_regression.check(results.json())
Beispiel #5
0
def test_valid_symbol_object(data_regression):
    results = ValidSymbol(symbol="aapl",
                          name="Apple Inc.",
                          exchange="NASDAQ",
                          asset_type="Equity")
    data_regression.check(results.json())
Beispiel #6
0
def test_profile_parser(data_regression, profile_page_fixture):  # noqa: F811
    elements = html_parser(profile_page_fixture)
    results = profile_parser(elements)
    data_regression.check(results)
Beispiel #7
0
def test_html_parser(data_regression, profile_page_fixture):  # noqa: F811
    elements = html_parser(profile_page_fixture)
    results = {k: v.text for k, v in elements.items()}
    data_regression.check(results)
Beispiel #8
0
def test_parse_quote_header_info(data_regression, summary_page_data_fixture):
    _, data = summary_page_data_fixture
    result = parse_quote_header_info(data)
    data_regression.check(result.json())
Beispiel #9
0
def test_parse_tweets(data_regression, timeline_items_fixtures,
                      index):  # noqa: F811
    results = parse_tweet(timeline_items_fixtures[index])
    data_regression.check(results)
Beispiel #10
0
def test_parse_trading_information_table(data_regression, statistics_page_data_fixture):
    result = parse_trading_information_table(statistics_page_data_fixture)
    data_regression.check(result.json())
Beispiel #11
0
def test_financial_highlights_table(data_regression, statistics_page_data_fixture):
    result = parse_financial_highlights_table(statistics_page_data_fixture)
    data_regression.check(result.json())