Skip to content

Commit

Permalink
Starting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaslek committed Jan 27, 2023
1 parent e34818a commit 55ad413
Show file tree
Hide file tree
Showing 40 changed files with 321,390 additions and 282,791 deletions.
2 changes: 1 addition & 1 deletion openbb_terminal/portfolio/portfolio_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def is_ticker(ticker: str) -> bool:
Whether the string is a ticker
"""
item = yf.Ticker(ticker)
return "previousClose" in item.info
return "previous_close" in item.fast_info


# TODO: Is this being used anywhere?
Expand Down
13 changes: 4 additions & 9 deletions openbb_terminal/stocks/fundamental_analysis/dcf_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def __init__(
"info": yf.Ticker(symbol).info,
"t_bill": get_rf(),
"r_ff": dcf_model.get_fama_coe(self.info["symbol"]),
"f_info": yf.Ticker(symbol).fast_info,
}

@log_start_end(log=logger)
Expand Down Expand Up @@ -592,9 +593,7 @@ def create_dcf(self):
font=dcf_static.red,
)
dcf_model.set_cell(self.ws[2], "A16", "Shares Outstanding")
dcf_model.set_cell(
self.ws[2], "B16", int(self.data["info"]["sharesOutstanding"])
)
dcf_model.set_cell(self.ws[2], "B16", int(self.data["f_info"]["shares"]))
dcf_model.set_cell(self.ws[2], "A17", "Shares Price")
dcf_model.set_cell(
self.ws[2],
Expand All @@ -603,9 +602,7 @@ def create_dcf(self):
num_form="[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00",
)
dcf_model.set_cell(self.ws[2], "A18", "Actual Price")
dcf_model.set_cell(
self.ws[2], "B18", float(self.data["info"]["regularMarketPrice"])
)
dcf_model.set_cell(self.ws[2], "B18", float(self.data["f_info"]["last_price"]))

@log_start_end(log=logger)
def create_header(self, ws: Workbook):
Expand Down Expand Up @@ -1090,9 +1087,7 @@ def add_ratios(self):
pdiv1 = dcf_model.get_value(val[1][1], "Preferred Dividends", j)[1]
opcf1 = dcf_model.get_value(val[1][2], "Operating Cash Flow", j)[1]

info, outstand = self.data["info"], float(
self.data["info"]["sharesOutstanding"]
)
info, outstand = self.data["info"], float(self.data["f_info"]["shares"])

# Enter row offset, number to display, and format number
rows = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ def get_mktcap(
)
if not df_data.empty:

data = yf.Ticker(symbol).info
data = yf.Ticker(symbol).fast_info
if data:
df_data["Adj Close"] = df_data["Adj Close"] * data["sharesOutstanding"]
df_data["Adj Close"] = df_data["Adj Close"] * data["shares"]
df_data = df_data["Adj Close"]

currency = data["currency"]
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

28,220 changes: 16,723 additions & 11,497 deletions tests/openbb_terminal/etf/cassettes/test_yfinance_model/test_get_etfs_by_name[ARKK].yaml

Large diffs are not rendered by default.

27,186 changes: 16,126 additions & 11,060 deletions tests/openbb_terminal/etf/cassettes/test_yfinance_model/test_get_etfs_by_name[ARKW].yaml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Technology": 37.21, "Healthcare": 36.76, "Communication Services": 13.62, "Consumer Cyclical": 11.57, "Consumer Defensive": 0.7, "Industrials": 0.01, "Real Estate": 0, "Basic Materials": 0, "Financial Services": 0, "Utilities": 0, "Energy": 0}
{"Technology": 39.95, "Healthcare": 36.79, "Communication Services": 13.05, "Consumer Cyclical": 9.55, "Consumer Defensive": 0.65, "Real Estate": 0, "Basic Materials": 0, "Financial Services": 0, "Utilities": 0, "Industrials": 0, "Energy": 0}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Technology": 51.24, "Communication Services": 20.4, "Consumer Cyclical": 15.4, "Healthcare": 6.33, "Consumer Defensive": 0.79, "Financial Services": 0.58, "Real Estate": 0, "Basic Materials": 0, "Utilities": 0, "Industrials": 0, "Energy": 0}
{"Technology": 55.11, "Communication Services": 18.89, "Consumer Cyclical": 13.03, "Healthcare": 6.32, "Consumer Defensive": 0.72, "Financial Services": 0.63, "Real Estate": 0, "Basic Materials": 0, "Utilities": 0, "Industrials": 0, "Energy": 0}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

Sector holdings of ARKF
% of holdings in the sector
Technology 59.49
Consumer Cyclical 16.78
Communication Services 10.61
Financial Services 9.95
Healthcare 3.08
Technology 60.81
Consumer Cyclical 16.41
Communication Services 10.27
Financial Services 9.52
Healthcare 2.92
Real Estate 0.00
Basic Materials 0.00
Consumer Defensive 0.00
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

Sector holdings of ARKW
% of holdings in the sector
Technology 51.24
Communication Services 20.40
Consumer Cyclical 15.40
Healthcare 6.33
Consumer Defensive 0.79
Financial Services 0.58
Technology 55.11
Communication Services 18.89
Consumer Cyclical 13.03
Healthcare 6.32
Consumer Defensive 0.72
Financial Services 0.63
Real Estate 0.00
Basic Materials 0.00
Utilities 0.00
Expand Down
Loading

0 comments on commit 55ad413

Please sign in to comment.