mirror of
https://github.com/hydrosquall/tiingo-python.git
synced 2025-12-18 12:24:18 +01:00
Test all Price Endpoints
This commit is contained in:
@@ -63,8 +63,11 @@ Then, use the TiingoClient to make your API calls. (Other parameters are availab
|
||||
# Get news articles about given tickers or search terms from given domains
|
||||
# Coming soon!
|
||||
|
||||
Further Docs
|
||||
--------
|
||||
|
||||
* Official Tiingo Documentation: https://api.tiingo.com
|
||||
* Tiingo-Pyhon Documentation (Under Construction): https://tiingo-python.readthedocs.io.
|
||||
* Tiingo-Python Documentation (Under Construction): https://tiingo-python.readthedocs.io.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
@@ -9,18 +9,26 @@ from tiingo import TiingoClient
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def response():
|
||||
"""Sample pytest fixture.
|
||||
|
||||
See more at: http://doc.pytest.org/en/latest/fixture.html
|
||||
"""
|
||||
def ticker_price_response():
|
||||
"""Test /tiingo/<ticker>/prices endpoint"""
|
||||
t = TiingoClient()
|
||||
return t.get_ticker_price("GOOGL")
|
||||
# return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
|
||||
|
||||
|
||||
def test_content(response):
|
||||
@pytest.fixture
|
||||
def ticker_metadata_response():
|
||||
"""Test /tiingo/<ticker> endpoint"""
|
||||
t = TiingoClient()
|
||||
return t.get_ticker_metadata("GOOGL")
|
||||
|
||||
|
||||
def test_ticker_price(ticker_price_response):
|
||||
"""Sample pytest test function with the pytest fixture as an argument."""
|
||||
# from bs4 import BeautifulSoup
|
||||
# assert 'GitHub' in BeautifulSoup(response.content).title.string
|
||||
assert len(response) > 0
|
||||
assert len(ticker_price_response) == 1
|
||||
assert ticker_price_response.get('adjClose')
|
||||
|
||||
|
||||
def test_ticker_metadata(ticker_metadata_response):
|
||||
"""Refactor this with python data schemavalidation"""
|
||||
assert ticker_metadata_response.get('ticker') == "GOOGL"
|
||||
assert ticker_metadata_response.get("name")
|
||||
|
||||
Reference in New Issue
Block a user