Example #1
0
def test_markets_schema():
    """validate /markets endpoint"""
    result = helpers.raw_request_get(endpoint='markets')

    schema = helpers.load_schema('markets.schema')

    jsonschema.validate(result, schema)
Example #2
0
def test_instruments_schema():
    """validate /instruments endpoint"""
    # TODO: instruments from API ROOT
    result = helpers.raw_request_get(endpoint='instruments')

    schema = helpers.load_schema('instruments.schema')

    jsonschema.validate(result, schema)
Example #3
0
def test_quotes_schema():
    """validate /quotes endpoint"""
    # TODO: not on API ROOT?
    result = helpers.raw_request_get(
        endpoint='quotes',
        params={'symbols': helpers.CONFIG.get('tests', 'good_stock_list')})

    schema = helpers.load_schema('quotes.schema')

    jsonschema.validate(result, schema)
Example #4
0
def test_news_schema():
    """validate /midlands/news/ endpoint"""
    # TODO: not on API ROOT?
    result = helpers.raw_request_get(
        endpoint_url='https://api.robinhood.com/midlands/news/',
        params={'symbol': helpers.CONFIG.get('tests', 'good_stock')})

    schema = helpers.load_schema('news.schema')

    jsonschema.validate(result, schema)
Example #5
0
def test_fundamentals_schema():
    """validate /fundamentals endpoint"""
    result = helpers.raw_request_get(
        endpoint_url='https://api.robinhood.com/fundamentals/',
        params={'symbols': helpers.CONFIG.get('tests', 'good_stock_list')},
    )

    schema = helpers.load_schema('fundamentals.schema')

    jsonschema.validate(result, schema)
Example #6
0
def test_dividends_schema():
    """validate /dividends endpoint"""
    token = helpers.xfail_can_auth()

    result = helpers.raw_request_get(
        endpoint='dividends',
        headers={'Authorization': 'Token ' + token},
    )

    schema = helpers.load_schema('dividends.schema')

    jsonschema.validate(result, schema)