Skip to content

Commit

Permalink
Save cookies only upon login.
Browse files Browse the repository at this point in the history
  • Loading branch information
thicccat688 committed Feb 7, 2023
1 parent c0f4073 commit 560170b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
Binary file modified mintospy/__pycache__/api.cpython-310.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions mintospy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ def get_investments(

def get_investment_filters(self, current: bool = False) -> dict:
"""
This seems to only work in a sequence of API calls, so it's not recommended to call it alone!
:param current: Set to True to get filters for current investments, else set to False
:return: Investment filters provided by Mintos
"""
Expand Down Expand Up @@ -869,6 +870,8 @@ def login(self) -> None:
timeout=30,
)

self._save_cookies()

def _save_cookies(self) -> None:
try:
self.cookies = self.driver.get_cookies()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='mintospy',
version='0.6.1',
version='0.6.2',
license='MIT',
author='Tomás Perestrelo',
author_email='[email protected]',
Expand Down
1 change: 1 addition & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_investments(current: bool, claims: bool):

@pytest.mark.parametrize('current', [True, False])
def test_investment_filters(current: bool):
# This seems to only work in a sequence of API calls, so it's not recommended to call it alone!
assert isinstance(mintos_client.get_investment_filters(current), dict)


Expand Down

0 comments on commit 560170b

Please sign in to comment.