Files
OpenBB/tests/openbb_terminal/alternative/oss/test_github_view.py
jose-donato 01391c2564 New Open Source menu (#1603)
* adds os menu

* remove tests

* fixed tests

* fixed date in sh

* updated alt controller tests

* updated api fecthing/handling

* lint

* updated website folder name and tests

* alt tests

* tests

* tests

* keys for github

* updated tests

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com>
Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
2022-04-04 19:08:50 +03:00

53 lines
1.4 KiB
Python

# IMPORTATION STANDARD
# IMPORTATION THIRDPARTY
import pytest
# IMPORTATION INTERNAL
from openbb_terminal.alternative.oss import github_view
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [
("User-Agent", None),
("Authorization", "MOCK_AUTHORIZATION"),
],
}
@pytest.mark.vcr
@pytest.mark.record_stdout
def test_display_star_history(mocker):
# MOCK EXPORT_DATA
mocker.patch(target="openbb_terminal.alternative.oss.github_view.export_data")
# MOCK VISUALIZE_OUTPUT
mocker.patch(target="openbb_terminal.helper_classes.TerminalStyle.visualize_output")
github_view.display_star_history(repo="openbb-finance/openbbterminal")
@pytest.mark.vcr
@pytest.mark.record_stdout
def test_display_top_repos(mocker):
# MOCK EXPORT_DATA
mocker.patch(target="openbb_terminal.alternative.oss.github_view.export_data")
# MOCK VISUALIZE_OUTPUT
mocker.patch(target="openbb_terminal.helper_classes.TerminalStyle.visualize_output")
github_view.display_top_repos(sortby="stars", categories="", limit=10)
@pytest.mark.vcr
@pytest.mark.record_stdout
def test_display_repo_summary(mocker):
# MOCK EXPORT_DATA
mocker.patch(target="openbb_terminal.alternative.oss.github_view.export_data")
github_view.display_repo_summary(
repo="openbb-finance/openbbterminal",
)