Merge branch 'main' into eda-menu

This commit is contained in:
DidierRLopes
2021-03-27 18:34:55 +00:00
committed by GitHub
2 changed files with 1286 additions and 3 deletions

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"])