コード例 #1
0
def test_prod_crawler_auth():
    """validate auth crawler on prod"""
    helpers.xfail_can_auth()

    endpoint = crawler.Endpoint(
        username=helpers.CONFIG.get('robinhood', 'username'),
        password=helpers.CONFIG.get('robinhood', 'password'),
    )

    positions = endpoint.accounts.results[0].positions._data

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

    jsonschema.validate(positions, schema)
コード例 #2
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)