Merge branch 'main' into fix-tkinter

This commit is contained in:
Artem Veremey
2021-03-27 11:26:51 -07:00
3 changed files with 1288 additions and 5 deletions

View File

@@ -139,8 +139,8 @@
### Short term
* [ ] Statistical techniques applied to a stock share price (e.g. decompose seasonality, trend, level, auto-correlation, cusum, ...) (@didier)
* [ ] Hypothesis tests (e.g. Kurtosis, Jarques-Bera, ARCH, ADF, ...) (@didier)
* [x] Summary statistics, cdf, histogram, box-whiskers, cusum, decompose (@didier) - [PR #289](https://github.com/DidierRLopes/GamestonkTerminal/pull/289)
* [ ] Residuals sub-menu with Hypothesis tests (e.g. Kurtosis, Jarques-Bera, ARCH, ADF, ... and such) (@didier)
### Long term

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,40 @@
""" discovery/short_interest_api.py tests """
import unittest
from unittest import mock
# pylint: disable=unused-import
from gamestonk_terminal.test_helper import ( # noqa: F401
parameterize_from_file,
pytest_generate_tests,
)
from gamestonk_terminal.discovery.short_interest_api import (
high_short_interest,
low_float,
)
assertions = unittest.TestCase("__init__")
class TestDiscoveryShortInterestApi(unittest.TestCase):
def test_high_short_interest(self):
class TestDiscoveryShortInterestApi:
@mock.patch("gamestonk_terminal.discovery.short_interest_api.requests")
@parameterize_from_file(
"test_high_short_interest",
"../tests/data/discovery_short_interest_api.yaml",
)
# pylint: disable=unused-argument
def test_high_short_interest(
self, mock_request_get, mock_high_short, expected_result
):
mock_request_get.get().text = mock_high_short
high_short_interest(["-n", "10"])
def test_low_float(self):
@mock.patch("gamestonk_terminal.discovery.short_interest_api.requests")
@parameterize_from_file(
"test_low_float",
"../tests/data/discovery_short_interest_api.yaml",
)
# pylint: disable=unused-argument
def test_low_float(self, mock_request_get, mock_low_float, expected_result):
mock_request_get.get().text = mock_low_float
low_float(["-n", "10"])