mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-05-07 06:23:26 +08:00
* Integration test batch 1 * Mark test * Update cli/integration/test_integration_obbject_registry.py Co-authored-by: Henrique Joaquim <henriquecjoaquim@gmail.com> * example of command tests * Add more test cases --------- Co-authored-by: Henrique Joaquim <henriquecjoaquim@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
30 lines
975 B
Python
30 lines
975 B
Python
import io
|
|
|
|
import pytest
|
|
from openbb_cli.cli import main
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"input_values",
|
|
[
|
|
"/equity/price/historical --symbol aapl --provider fmp",
|
|
"/equity/price/historical --symbol msft --provider yfinance",
|
|
"/equity/price/historical --symbol goog --provider polygon",
|
|
"/crypto/price/historical --symbol btc --provider fmp",
|
|
"/currency/price/historical --symbol eur --provider fmp",
|
|
"/derivatives/futures/historical --symbol cl --provider fmp",
|
|
"/etf/price/historical --symbol spy --provider fmp",
|
|
"/economy",
|
|
],
|
|
)
|
|
@pytest.mark.integration
|
|
def test_launch_with_cli_input(monkeypatch, input_values):
|
|
"""Test launching the CLI and providing input via stdin with multiple parameters."""
|
|
stdin = io.StringIO(input_values)
|
|
monkeypatch.setattr("sys.stdin", stdin)
|
|
|
|
try:
|
|
main()
|
|
except Exception as e:
|
|
pytest.fail(f"Main function raised an exception: {e}")
|