From 19c52bec6af3aa8f694c16be3f8bcaeed5238973 Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Wed, 26 Apr 2023 16:19:31 +0200 Subject: [PATCH 1/2] Increase integration test coverage (#4902) * Create and update tests * Create and update tests --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> --- .../alternative/test_alt.openbb | 11 ++++++ .../cryptocurrency/test_crypto_defi.openbb | 4 +- .../cryptocurrency/test_crypto_onchain.openbb | 4 ++ .../economy/test_economoy_qa.openbb | 38 +++++++++++++++++++ .../etf/test_etf.openbb | 7 ++++ .../forex/test_forex_base.openbb | 11 ++++++ .../forex/test_forex_ta.openbb | 3 ++ .../futures/test_futures.openbb | 2 + .../mutual_funds/test_mutual_fund.openbb | 13 +++++++ .../stocks/test_stocks.openbb | 32 ++++++++++++++++ .../stocks/test_stocks_dps.openbb | 3 ++ .../stocks/test_stocks_res.openbb | 6 +++ .../stocks/test_stocks_ta.openbb | 5 +++ 13 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 openbb_terminal/miscellaneous/integration_tests_scripts/alternative/test_alt.openbb create mode 100644 openbb_terminal/miscellaneous/integration_tests_scripts/economy/test_economoy_qa.openbb create mode 100644 openbb_terminal/miscellaneous/integration_tests_scripts/mutual_funds/test_mutual_fund.openbb create mode 100644 openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_res.openbb diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/alternative/test_alt.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/alternative/test_alt.openbb new file mode 100644 index 00000000000..19b61c2b9d2 --- /dev/null +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/alternative/test_alt.openbb @@ -0,0 +1,11 @@ +alternative +hn -l 5 +covid +.. +oss +.. +realestate +.. +help +reset +exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/cryptocurrency/test_crypto_defi.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/cryptocurrency/test_crypto_defi.openbb index d52a1535630..7cc8708d917 100644 --- a/openbb_terminal/miscellaneous/integration_tests_scripts/cryptocurrency/test_crypto_defi.openbb +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/cryptocurrency/test_crypto_defi.openbb @@ -13,7 +13,7 @@ vaults --chain ${crypto_full=ethereum} --protocol aave --kind stable --top 3 --l vaults --chain ${crypto_full=ethereum} -s apy -r # tokens -tokens +tokens # this is running into a timeout issue tokens --skip 3 --limit 3 --sort totalLiquidity tokens --sort txCount --reverse @@ -68,6 +68,8 @@ sreturn --limit 200 anchor --address terra13kc0x8kr3sq8226myf4nmanmn2mrk9s5s9wsnz anchor --address terra13kc0x8kr3sq8226myf4nmanmn2mrk9s5s9wsnz --transactions +help +reset exit # TERRA ADDRESSES FOR EXAMPLES diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/cryptocurrency/test_crypto_onchain.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/cryptocurrency/test_crypto_onchain.openbb index d0c18819d7e..75280448c62 100644 --- a/openbb_terminal/miscellaneous/integration_tests_scripts/cryptocurrency/test_crypto_onchain.openbb +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/cryptocurrency/test_crypto_onchain.openbb @@ -73,6 +73,10 @@ prices --sort volumeConverted --reverse # loads transaction hash address 0x9dc7b43ad4288c624fdd236b2ecb9f2b81c93e706b2ffd1d19b112c1df7849e6 -tx +hr -i 1w + # tx +help +reset exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/economy/test_economoy_qa.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/economy/test_economoy_qa.openbb new file mode 100644 index 00000000000..860336c4f01 --- /dev/null +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/economy/test_economoy_qa.openbb @@ -0,0 +1,38 @@ +economy +macro +treasury +qa + +# Statistics +summary +normality +unitroot + +# Plots +line +line --log +hist +hist -b 10 +cdf +bw +bw -y +acf +qqplot + +# Rolling Metrics +rolling +spread +quantile +skew +kurtosis + +# Other +raw -r +decompose +decompose -m +cusum + +pick united_states_CPI +help +reset +exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/etf/test_etf.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/etf/test_etf.openbb index 62c0fb3e1b9..a9257419637 100644 --- a/openbb_terminal/miscellaneous/integration_tests_scripts/etf/test_etf.openbb +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/etf/test_etf.openbb @@ -10,4 +10,11 @@ candle --sort adjclose --reverse --raw candle -t --ma 4 news compare spy,ivv +disc +.. +help +search -n vol +ta +.. +reset exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/forex/test_forex_base.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/forex/test_forex_base.openbb index bde2ad1ba06..cd55e6af7a9 100644 --- a/openbb_terminal/miscellaneous/integration_tests_scripts/forex/test_forex_base.openbb +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/forex/test_forex_base.openbb @@ -6,4 +6,15 @@ fwd quote quote --source YahooFinance quote --source AlphaVantage +candle --sort open -r --raw --limit 10 +candle -t +help +oanda +qa +.. +ta +.. +forecast +.. +reset exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/forex/test_forex_ta.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/forex/test_forex_ta.openbb index 9e8ffc1b647..0ff92521e81 100644 --- a/openbb_terminal/miscellaneous/integration_tests_scripts/forex/test_forex_ta.openbb +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/forex/test_forex_ta.openbb @@ -45,4 +45,7 @@ aroon bbands donchian fib +ad -l 15 -d 2 +help +reset exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/futures/test_futures.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/futures/test_futures.openbb index 0d9f9cd38b6..7a57faaaae7 100644 --- a/openbb_terminal/miscellaneous/integration_tests_scripts/futures/test_futures.openbb +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/futures/test_futures.openbb @@ -6,4 +6,6 @@ historical OJ -s 2022-01-01 -e 2022-01-20 historical M6B,MSF,M6E curve OJ curve CL --raw +help +reset exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/mutual_funds/test_mutual_fund.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/mutual_funds/test_mutual_fund.openbb new file mode 100644 index 00000000000..0ce36eb0177 --- /dev/null +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/mutual_funds/test_mutual_fund.openbb @@ -0,0 +1,13 @@ +funds +country --name united_states +search --fund morning +load --fund Vanguard +plot -c both +sector -t equity +sector -t fixed_income +holdings -t all +carbon +exclusion +help +reset +exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks.openbb index a9a76c73830..714286bbfdf 100644 --- a/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks.openbb +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks.openbb @@ -11,4 +11,36 @@ candle --raw candle --sort AdjClose -r --raw codes news -l 3 +th +.. +options +.. +disc +.. +dps +.. +scr +.. +ins +.. +gov +.. +ba +.. +ca +.. +fa +.. +bt +.. +ta +.. +qa +.. +forecast +.. +res +.. +help +reset exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_dps.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_dps.openbb index d956145da9e..e1a5242d8d8 100644 --- a/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_dps.openbb +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_dps.openbb @@ -13,4 +13,7 @@ ftd load ${ticker=aapl} -i 5 ftd -n 5 --raw dpotc +# prom -t T1 +help +reset exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_res.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_res.openbb new file mode 100644 index 00000000000..3e9ce7a9c44 --- /dev/null +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_res.openbb @@ -0,0 +1,6 @@ +stocks +load ${ticker=aapl} +res +help +reset +exit diff --git a/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_ta.openbb b/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_ta.openbb index caab488a07b..e4adb76f63f 100644 --- a/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_ta.openbb +++ b/openbb_terminal/miscellaneous/integration_tests_scripts/stocks/test_stocks_ta.openbb @@ -77,4 +77,9 @@ ad adosc obv fib +atr +cones +multi -i macd[12,26,9],rsi,sma[20] +help +reset exit From df9a15497de3c8d93d9d79150cf794dd290ed7d6 Mon Sep 17 00:00:00 2001 From: teh_coderer Date: Wed, 26 Apr 2023 10:41:58 -0400 Subject: [PATCH 2/2] post main merge --- .../miscellaneous/models/hub_credentials.json | 2 -- poetry.lock | 34 +++++++++---------- pyproject.toml | 2 +- requirements-full.txt | 2 +- requirements.txt | 2 +- tests/openbb_terminal/test_keys_controller.py | 2 -- 6 files changed, 20 insertions(+), 24 deletions(-) diff --git a/openbb_terminal/miscellaneous/models/hub_credentials.json b/openbb_terminal/miscellaneous/models/hub_credentials.json index 633f70884c2..47891a407ab 100644 --- a/openbb_terminal/miscellaneous/models/hub_credentials.json +++ b/openbb_terminal/miscellaneous/models/hub_credentials.json @@ -9,8 +9,6 @@ "API_NEWS_TOKEN": "", "API_CMC_KEY": "", "API_FINNHUB_KEY": "", - "API_IEX_TOKEN": "", - "API_SENTIMENTINVESTOR_TOKEN": "", "API_WHALE_ALERT_KEY": "", "API_GLASSNODE_KEY": "", "API_COINGLASS_KEY": "", diff --git a/poetry.lock b/poetry.lock index 56c09499732..557d23fba1e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. [[package]] name = "absl-py" @@ -6461,31 +6461,31 @@ files = [ [[package]] name = "pywry" -version = "0.4.8" +version = "0.5.0" description = "" category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "pywry-0.4.8-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:ed25402bb742d24d5ec0531b14b37fc1321f9f7387743e74bbd7c60383361895"}, - {file = "pywry-0.4.8-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:9375400d8db85e885459b723ab7261f2f8a84daeda12ff0e9cb00f51ab540c75"}, - {file = "pywry-0.4.8-cp310-none-win_amd64.whl", hash = "sha256:081ddc8b6bd1656d94c23c79aab11c18ba2f30fae5d05764409ddf933f7e1398"}, - {file = "pywry-0.4.8-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:98260336dc01c638546b7360a9219bb21c0563e58b0cd8093dc59e8e9032ffaa"}, - {file = "pywry-0.4.8-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:304509551ad797b738105037e0ce881502f4b272aa93a0c1dc6afcd4b67d25f9"}, - {file = "pywry-0.4.8-cp311-none-win_amd64.whl", hash = "sha256:b7c41369997071be16bebde755e34dacce05a3420bbec3c116a5403e50a0ee0f"}, - {file = "pywry-0.4.8-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:26d5902e26ac48f9996169d9bb1cbd86930fb8d5cf2941d2d329d5f36088d476"}, - {file = "pywry-0.4.8-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:5aa3b62a6c0b95ee3c842f594f2bb0c4090a63b3573e2515fcb7c06b02bc5ba1"}, - {file = "pywry-0.4.8-cp38-none-win_amd64.whl", hash = "sha256:3df9986f8ad7b8bb4c4fd8644bd785f3b23a01c2f9a377df7875974beab25c00"}, - {file = "pywry-0.4.8-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:0c57fee1746a84d19fa46142db7f394236a7e6fad78f10be44fd23c1310b990c"}, - {file = "pywry-0.4.8-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:18b0be063650dfcc46b03f61ed97a4a32dbd2956feee1b9a8e94a7a2a82da960"}, - {file = "pywry-0.4.8-cp39-none-win_amd64.whl", hash = "sha256:dc1367aa1eb435743a7105cd7352189201662a7cdbc22415c08cab68e0fad931"}, - {file = "pywry-0.4.8.tar.gz", hash = "sha256:5ca24922bd406cd9054b11d019a81f5769a5cacfc6de9fc3ce1b091981c99f7e"}, + {file = "pywry-0.5.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:bba57144a054027084c9b8829fc92a98742b6eeaef895670d0301be103292a18"}, + {file = "pywry-0.5.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:dd5b1806075682dd6a7b9715dad044bf625ac09ea04447a95c2c3af356b68d05"}, + {file = "pywry-0.5.0-cp310-none-win_amd64.whl", hash = "sha256:7dba52d39c156214a04b9f4003b02805c9c3c5ae63cf121dd2174e0f35c4f5a2"}, + {file = "pywry-0.5.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:169c3732f1fa7066d250b9603d3d6dc4aa67d0b62433f254b596a0fe97afe52f"}, + {file = "pywry-0.5.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:f04cd9d0cebadbaf8fbbec851f24c3d8b0468408514069b8421e4db497fbaffa"}, + {file = "pywry-0.5.0-cp311-none-win_amd64.whl", hash = "sha256:9920a1a4acc8058655075fb52c31f53b1f8438462c8b9947c4f7cd302ced1ae9"}, + {file = "pywry-0.5.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:dd40af058a2731037fb53f81d3fa12b014eb5b6110bbc2ab1792a005c5f9bd8c"}, + {file = "pywry-0.5.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:4f39c990feb98be4e4f1d30d4fd750fe7c74f288698ebfff484d3ae0451ffe74"}, + {file = "pywry-0.5.0-cp38-none-win_amd64.whl", hash = "sha256:2959b2ff68b1548958ed4eec6fe0f2ffe4d20120385c8300a5da5e48aef71022"}, + {file = "pywry-0.5.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:93a375cb67e7c954460a5025de17bab0a22f3e396e87532ab68dec7a36a2200d"}, + {file = "pywry-0.5.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:0f89efec669a0445b758894bb6b26fdbad82140b0912da45b64d8e7aab0d4d68"}, + {file = "pywry-0.5.0-cp39-none-win_amd64.whl", hash = "sha256:0a54b8435f754c7f2e03e2a04c67bfc2c4da2931488fdd22cf5ae7b78c6f2c2b"}, + {file = "pywry-0.5.0.tar.gz", hash = "sha256:29b594ace5dde2047f0cb167df2cfa7ae76b8adc8c27947f03300cb64517c11e"}, ] [package.dependencies] psutil = ">=5.8.0,<5.9.4" setproctitle = "*" -websockets = ">=11.0.1" +websockets = "*" [package.extras] dev = ["auditwheel", "wheel"] @@ -9656,4 +9656,4 @@ optimization = ["Riskfolio-Lib"] [metadata] lock-version = "2.0" python-versions = "^3.8,<3.11, !=3.9.7" -content-hash = "f750f2d47909d1f88e2b0fae74dd6c812f30f5a9923d46f528f22dc6034d0036" +content-hash = "d2bc3a75f2aff5123a842c656d6e8a9d51fa829433dc0cb1a02deb1d5c6967d9" diff --git a/pyproject.toml b/pyproject.toml index 4501104e3c3..889c4832760 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,7 +101,7 @@ jupyterlab-widgets = "^3.0.3" mstarpy = "^0.0.4" packaging = ">=22.0" streamlit = "^1.21.0" -pywry = "^0.4.8" +pywry = "^0.5.0" svglib = "^1.5.0" sparqlwrapper = "^2.0.0" y-py = "!=0.5.5" # Untraceable third level dependency that requires cargo to be built diff --git a/requirements-full.txt b/requirements-full.txt index 8b921a453dc..b4e35ccb566 100644 --- a/requirements-full.txt +++ b/requirements-full.txt @@ -265,7 +265,7 @@ pytz==2022.7.1 ; python_version >= "3.8" and python_full_version != "3.9.7" and pywin32-ctypes==0.2.0 ; python_version >= "3.8" and python_version < "3.11" and python_full_version != "3.9.7" and sys_platform == "win32" pywin32==305 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" pywinpty==2.0.10 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" and os_name == "nt" -pywry==0.4.8 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" +pywry==0.5.0 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" pyyaml==6.0 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" pyzmq==25.0.1 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" qdldl==0.1.5.post3 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" diff --git a/requirements.txt b/requirements.txt index 8c2521e3d1b..9490ac55b3f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -182,7 +182,7 @@ pytz-deprecation-shim==0.1.0.post0 ; python_version >= "3.8" and python_full_ver pytz==2022.7.1 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" pywin32==305 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" pywinpty==2.0.10 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" and os_name == "nt" -pywry==0.4.8 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" +pywry==0.5.0 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" pyyaml==6.0 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" pyzmq==25.0.1 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" quandl==3.7.0 ; python_version >= "3.8" and python_full_version != "3.9.7" and python_version < "3.11" diff --git a/tests/openbb_terminal/test_keys_controller.py b/tests/openbb_terminal/test_keys_controller.py index 451ba653371..10c2de4d5cf 100644 --- a/tests/openbb_terminal/test_keys_controller.py +++ b/tests/openbb_terminal/test_keys_controller.py @@ -48,7 +48,6 @@ class MockCFG: self.API_TRADIER_TOKEN = kwargs.get("TRADIER", None) self.API_CMC_KEY = kwargs.get("CMC", None) self.API_FINNHUB_KEY = kwargs.get("FINNHUB", None) - self.API_IEX_TOKEN = kwargs.get("IEX", None) self.API_REDDIT_CLIENT_ID = kwargs.get("REDDIT_CLIENT", None) self.API_REDDIT_CLIENT_SECRET = kwargs.get("REDDIT_SECRET", None) self.API_REDDIT_USERNAME = kwargs.get("REDDIT_USERNAME", None) @@ -65,7 +64,6 @@ class MockCFG: self.API_BINANCE_KEY = kwargs.get("BINANCE", None) self.API_BINANCE_SECRET = kwargs.get("BINANCE", None) self.API_BITQUERY_KEY = kwargs.get("BITQUERY", None) - self.API_SENTIMENTINVESTOR_TOKEN = kwargs.get("SI", None) self.API_COINBASE_KEY = kwargs.get("COINBASE", None) self.API_COINBASE_SECRET = kwargs.get("COINBASE", None) self.API_COINBASE_PASS_PHRASE = kwargs.get("COINBASE", None)