From 583188cd4237b0aa89914aa0d264d9e5ec22ec04 Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 28 Jul 2025 23:02:35 +1000 Subject: [PATCH 01/11] Extended product with additional functionalities --- stake/product.py | 26 +++++++++++++++++++++----- stake/ratings.py | 2 +- stake/transaction.py | 6 +++--- tests/test_integration.py | 13 +++++++++++++ 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/stake/product.py b/stake/product.py index 938df45..50acdaa 100644 --- a/stake/product.py +++ b/stake/product.py @@ -1,12 +1,17 @@ import uuid -from datetime import datetime -from typing import Any, List, Optional +from datetime import date, datetime, timedelta +from typing import TYPE_CHECKING, Any, List, Optional -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, PrivateAttr from pydantic.fields import Field from stake.common import BaseClient, camelcase +if TYPE_CHECKING: + from stake.ratings import Rating + from stake.statement import Statement + from stake.client import StakeClient + __all__ = ["ProductSearchByName"] @@ -54,8 +59,19 @@ class Product(BaseModel): inception_date: Optional[datetime] = None instrument_tags: List[Any] child_instruments: List[Instrument] + _client: "StakeClient" = PrivateAttr() model_config = ConfigDict(alias_generator=camelcase) + def model_post_init(self, context: Any) -> None: + self._client = context.get("client") + + async def ratings(self) -> "List[Rating]": + from stake import RatingsRequest + return await self._client.ratings.list(RatingsRequest(symbols=[self.symbol])) + + async def statements(self, start_date: date | None = None) -> "List[Statement]": + from stake.statement import StatementRequest + return await self._client.statements.list(StatementRequest(symbol=self.symbol, start_date=start_date or (date.today() - timedelta(days=365)))) class ProductsClient(BaseClient): async def get(self, symbol: str) -> Optional[Product]: @@ -68,13 +84,13 @@ async def get(self, symbol: str) -> Optional[Product]: self._client.exchange.symbol.format(symbol=symbol) ) - return Product(**data["products"][0]) if data["products"] else None + return Product.model_validate(data["products"][0], context=dict(client=self._client)) if data["products"] else None async def search(self, request: ProductSearchByName) -> List[Instrument]: products = await self._client.get( self._client.exchange.products_suggestions.format(keyword=request.keyword) ) - return [Instrument(**product) for product in products["instruments"]] + return [Instrument.model_validate(product) for product in products["instruments"]] async def product_from_instrument( self, instrument: Instrument diff --git a/stake/ratings.py b/stake/ratings.py index dc0e6a7..33a133d 100644 --- a/stake/ratings.py +++ b/stake/ratings.py @@ -36,7 +36,7 @@ class Rating(pydantic.BaseModel): url_news: Optional[str] = None analyst_name: Optional[str] = None - @pydantic.field_validator("pt_prior", "rating_prior", mode="before") + @pydantic.field_validator("pt_prior", "rating_prior", "pt_current", "rating_current", mode="before") @classmethod def pt_prior_blank_string(cls, value, *args) -> Optional[str]: return None if value == "" else value diff --git a/stake/transaction.py b/stake/transaction.py index 36b0e46..b69f5e6 100644 --- a/stake/transaction.py +++ b/stake/transaction.py @@ -1,6 +1,6 @@ import enum import json -from datetime import datetime, timedelta +from datetime import datetime, timedelta, UTC from enum import Enum from typing import Dict, List, Optional @@ -18,9 +18,9 @@ class TransactionRecordEnumDirection(str, Enum): class TransactionRecordRequest(BaseModel): - to: datetime = Field(default_factory=datetime.utcnow) + to: datetime = Field(default_factory=lambda *_: datetime.now(UTC)) from_: datetime = Field( - default_factory=lambda *_: datetime.utcnow() - timedelta(days=365), alias="from" + default_factory=lambda *_: datetime.now(UTC) - timedelta(days=365), alias="from" ) limit: int = 1000 offset: Optional[datetime] = None diff --git a/tests/test_integration.py b/tests/test_integration.py index 034c12b..53d5ec5 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -53,3 +53,16 @@ async def test_integration_ASX(exchange): ) result = await session.transactions.list(request=request) assert len(result.transactions) == 10 + + + +@pytest.mark.parametrize("exchange", (constant.NYSE,)) +@pytest.mark.asyncio +async def test_integration_product(exchange): + async with stake.StakeClient(exchange=exchange) as session: + product = await session.products.get("AAPL") + assert product is not None + ratings = await product.ratings() + assert len(ratings) > 0 + statements = await product.statements() + assert len(statements) > 0 \ No newline at end of file From 125ced803bf84964740988c88ec84e662caf3f54 Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 28 Jul 2025 23:05:56 +1000 Subject: [PATCH 02/11] Extended product with additional functionalities --- stake/product.py | 26 +++++++++++++++++++++----- stake/ratings.py | 4 +++- stake/transaction.py | 2 +- tests/test_integration.py | 3 +-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/stake/product.py b/stake/product.py index 50acdaa..9c4654d 100644 --- a/stake/product.py +++ b/stake/product.py @@ -8,10 +8,10 @@ from stake.common import BaseClient, camelcase if TYPE_CHECKING: + from stake.client import StakeClient from stake.ratings import Rating from stake.statement import Statement - from stake.client import StakeClient - + __all__ = ["ProductSearchByName"] @@ -67,11 +67,19 @@ def model_post_init(self, context: Any) -> None: async def ratings(self) -> "List[Rating]": from stake import RatingsRequest + return await self._client.ratings.list(RatingsRequest(symbols=[self.symbol])) async def statements(self, start_date: date | None = None) -> "List[Statement]": from stake.statement import StatementRequest - return await self._client.statements.list(StatementRequest(symbol=self.symbol, start_date=start_date or (date.today() - timedelta(days=365)))) + + return await self._client.statements.list( + StatementRequest( + symbol=self.symbol, + start_date=start_date or (date.today() - timedelta(days=365)), + ) + ) + class ProductsClient(BaseClient): async def get(self, symbol: str) -> Optional[Product]: @@ -84,13 +92,21 @@ async def get(self, symbol: str) -> Optional[Product]: self._client.exchange.symbol.format(symbol=symbol) ) - return Product.model_validate(data["products"][0], context=dict(client=self._client)) if data["products"] else None + return ( + Product.model_validate( + data["products"][0], context=dict(client=self._client) + ) + if data["products"] + else None + ) async def search(self, request: ProductSearchByName) -> List[Instrument]: products = await self._client.get( self._client.exchange.products_suggestions.format(keyword=request.keyword) ) - return [Instrument.model_validate(product) for product in products["instruments"]] + return [ + Instrument.model_validate(product) for product in products["instruments"] + ] async def product_from_instrument( self, instrument: Instrument diff --git a/stake/ratings.py b/stake/ratings.py index 33a133d..ce4f517 100644 --- a/stake/ratings.py +++ b/stake/ratings.py @@ -36,7 +36,9 @@ class Rating(pydantic.BaseModel): url_news: Optional[str] = None analyst_name: Optional[str] = None - @pydantic.field_validator("pt_prior", "rating_prior", "pt_current", "rating_current", mode="before") + @pydantic.field_validator( + "pt_prior", "rating_prior", "pt_current", "rating_current", mode="before" + ) @classmethod def pt_prior_blank_string(cls, value, *args) -> Optional[str]: return None if value == "" else value diff --git a/stake/transaction.py b/stake/transaction.py index b69f5e6..9e29f79 100644 --- a/stake/transaction.py +++ b/stake/transaction.py @@ -1,6 +1,6 @@ import enum import json -from datetime import datetime, timedelta, UTC +from datetime import UTC, datetime, timedelta from enum import Enum from typing import Dict, List, Optional diff --git a/tests/test_integration.py b/tests/test_integration.py index 53d5ec5..787b749 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -55,7 +55,6 @@ async def test_integration_ASX(exchange): assert len(result.transactions) == 10 - @pytest.mark.parametrize("exchange", (constant.NYSE,)) @pytest.mark.asyncio async def test_integration_product(exchange): @@ -65,4 +64,4 @@ async def test_integration_product(exchange): ratings = await product.ratings() assert len(ratings) > 0 statements = await product.statements() - assert len(statements) > 0 \ No newline at end of file + assert len(statements) > 0 From 680594a04283ea194210eaab6a9d923899623208 Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 28 Jul 2025 23:07:11 +1000 Subject: [PATCH 03/11] Added assertion --- stake/product.py | 1 + 1 file changed, 1 insertion(+) diff --git a/stake/product.py b/stake/product.py index 9c4654d..512b0ee 100644 --- a/stake/product.py +++ b/stake/product.py @@ -64,6 +64,7 @@ class Product(BaseModel): def model_post_init(self, context: Any) -> None: self._client = context.get("client") + assert self._client async def ratings(self) -> "List[Rating]": from stake import RatingsRequest From cd132d6078c0151b8c0692eb0744375b2131cd7b Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 28 Jul 2025 23:12:18 +1000 Subject: [PATCH 04/11] Updated failing tests --- stake/product.py | 7 ++++--- stake/ratings.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/stake/product.py b/stake/product.py index 512b0ee..b6a5ab5 100644 --- a/stake/product.py +++ b/stake/product.py @@ -62,9 +62,10 @@ class Product(BaseModel): _client: "StakeClient" = PrivateAttr() model_config = ConfigDict(alias_generator=camelcase) - def model_post_init(self, context: Any) -> None: - self._client = context.get("client") - assert self._client + def model_post_init(self, context: Any | None = None) -> None: + if context: + self._client = context.get("client") + assert self._client async def ratings(self) -> "List[Rating]": from stake import RatingsRequest diff --git a/stake/ratings.py b/stake/ratings.py index ce4f517..92f69c8 100644 --- a/stake/ratings.py +++ b/stake/ratings.py @@ -40,7 +40,7 @@ class Rating(pydantic.BaseModel): "pt_prior", "rating_prior", "pt_current", "rating_current", mode="before" ) @classmethod - def pt_prior_blank_string(cls, value, *args) -> Optional[str]: + def remove_blank_strings(cls, value, *args) -> Optional[str]: return None if value == "" else value From b8fe9187e86ef3a193dfd4aa307a120a5eb085d4 Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 28 Jul 2025 23:17:00 +1000 Subject: [PATCH 05/11] Updated import --- stake/transaction.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stake/transaction.py b/stake/transaction.py index 9e29f79..7b3ed57 100644 --- a/stake/transaction.py +++ b/stake/transaction.py @@ -1,6 +1,6 @@ import enum import json -from datetime import UTC, datetime, timedelta +from datetime import datetime, timedelta, timezone from enum import Enum from typing import Dict, List, Optional @@ -18,9 +18,9 @@ class TransactionRecordEnumDirection(str, Enum): class TransactionRecordRequest(BaseModel): - to: datetime = Field(default_factory=lambda *_: datetime.now(UTC)) + to: datetime = Field(default_factory=lambda *_: datetime.now(timezone.UTC)) from_: datetime = Field( - default_factory=lambda *_: datetime.now(UTC) - timedelta(days=365), alias="from" + default_factory=lambda *_: datetime.now(timezone.UTC) - timedelta(days=365), alias="from" ) limit: int = 1000 offset: Optional[datetime] = None From 9ac573d3ae6561a23f30dc4bfec8d8f87014d9af Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 28 Jul 2025 23:19:13 +1000 Subject: [PATCH 06/11] Trying to fix utc --- stake/transaction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stake/transaction.py b/stake/transaction.py index 7b3ed57..bf5036c 100644 --- a/stake/transaction.py +++ b/stake/transaction.py @@ -18,9 +18,9 @@ class TransactionRecordEnumDirection(str, Enum): class TransactionRecordRequest(BaseModel): - to: datetime = Field(default_factory=lambda *_: datetime.now(timezone.UTC)) + to: datetime = Field(default_factory=lambda *_: datetime.now(timezone.utc)) from_: datetime = Field( - default_factory=lambda *_: datetime.now(timezone.UTC) - timedelta(days=365), alias="from" + default_factory=lambda *_: datetime.now(timezone.utc) - timedelta(days=365), alias="from" ) limit: int = 1000 offset: Optional[datetime] = None From 29c725a3264c5e7496b0cf10a7759b4642739bbe Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 28 Jul 2025 23:21:19 +1000 Subject: [PATCH 07/11] run black --- stake/transaction.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stake/transaction.py b/stake/transaction.py index bf5036c..75066b3 100644 --- a/stake/transaction.py +++ b/stake/transaction.py @@ -20,7 +20,8 @@ class TransactionRecordEnumDirection(str, Enum): class TransactionRecordRequest(BaseModel): to: datetime = Field(default_factory=lambda *_: datetime.now(timezone.utc)) from_: datetime = Field( - default_factory=lambda *_: datetime.now(timezone.utc) - timedelta(days=365), alias="from" + default_factory=lambda *_: datetime.now(timezone.utc) - timedelta(days=365), + alias="from", ) limit: int = 1000 offset: Optional[datetime] = None From 5ee408d483d6fc384bacd5af3adc4be04ca5c942 Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 1 Sep 2025 22:38:12 +1000 Subject: [PATCH 08/11] Removed deprecated --- stake/asx/common.py | 1 + stake/constant.py | 9 - stake/watchlist.py | 68 +---- .../test_watchlist/test_add_to_watchlist.yaml | 66 ++--- ..._create_watchlist[exchange0-symbols0].yaml | 147 ++++++---- ..._create_watchlist[exchange1-symbols1].yaml | 121 +++++--- .../test_watchlist/test_list_watchlist.yaml | 265 +----------------- .../test_remove_from_watchlist.yaml | 66 ++--- tests/test_watchlist.py | 29 -- 9 files changed, 260 insertions(+), 512 deletions(-) diff --git a/stake/asx/common.py b/stake/asx/common.py index 069f789..3d85c8b 100644 --- a/stake/asx/common.py +++ b/stake/asx/common.py @@ -11,3 +11,4 @@ class TradeType(str, Enum): MARKET = "MARKET_TO_LIMIT" LIMIT = "LIMIT" + STOP = "STOP" diff --git a/stake/constant.py b/stake/constant.py index 61cd94c..ac6ecf2 100644 --- a/stake/constant.py +++ b/stake/constant.py @@ -71,15 +71,6 @@ class NYSEUrl(BaseModel): ) users: str = urljoin(STAKE_URL, "user", allow_fragments=True) - # deprecated, use update_watchlist instead - watchlist_modify: str = urljoin( - STAKE_URL, "instruments/addRemoveInstrumentWatchlist", allow_fragments=True - ) - # deprecated, use read_watchlist instead - watchlist: str = urljoin( - STAKE_URL, "products/productsWatchlist/{userId}", allow_fragments=True - ) - watchlists: str = "https://api.prd.stakeover.io/us/instrument/watchlists" create_watchlist: str = "https://api.prd.stakeover.io/us/instrument/watchlist" read_watchlist: str = ( diff --git a/stake/watchlist.py b/stake/watchlist.py index 94a8d21..2838f2e 100644 --- a/stake/watchlist.py +++ b/stake/watchlist.py @@ -1,7 +1,6 @@ import uuid from datetime import datetime from typing import List, Optional, Union -from warnings import warn from pydantic import BaseModel, ConfigDict, Field @@ -42,6 +41,7 @@ class CreateWatchlistRequest(BaseModel): """This is used to create a new watchlist.""" name: str + tickers: List[str] | None = None class UpdateWatchlistRequest(BaseModel): @@ -98,59 +98,6 @@ async def _modify_watchlist( return WatchlistResponse(symbol=request.symbol, watching=data["watching"]) - async def add(self, request: AddToWatchlistRequest) -> WatchlistResponse: - """Adds a symbol to the watchlist. - - Args: - request (AddToWatchlistRequest): The request containing the symbol. - - Returns: - WatchlistResponse: The result of the watchlist modification. - """ - warn( - "This method is deprecated, please use `add_to_watchlist` instead.", - DeprecationWarning, - stacklevel=2, - ) - - return await self._modify_watchlist(request) - - async def remove(self, request: RemoveFromWatchlistRequest) -> WatchlistResponse: - """Removes a symbol from the watchlist. - - Args: - request (RemoveFromWatchlistRequest): The request containing the symbol - - Returns: - WatchlistResponse: The result of the watchlist modification. - """ - warn( - "This method is deprecated, please use `remove_from_watchlist` instead.", - DeprecationWarning, - stacklevel=2, - ) - - return await self._modify_watchlist(request) - - async def list(self) -> List[WatchlistProduct]: - """Lists all the contents of your watchlist. - - Returns: - List[WatchlistProduct]: The list of items in your watchlist. - """ - warn( - "This method is deprecated, please use `watchlist` instead.", - DeprecationWarning, - stacklevel=2, - ) - - watchlist = await self._client.get( - self._client.exchange.watchlist.format(userId=self._client.user.id) - ) - return [ - WatchlistProduct(**watched) for watched in watchlist["instrumentsWatchList"] - ] - async def watchlist(self, request: GetWatchlistRequest) -> Watchlist: """Retrieves a watchlist by id. @@ -188,14 +135,11 @@ async def create_watchlist( watchlist_id = response.get("newWatchlistId", None) assert watchlist_id, "Could not get a new watchlist" - return next( - ( - Watchlist(**watchlist_data) - for watchlist_data in response["watchlists"] - if watchlist_data["watchlistId"] == watchlist_id - ), - None, - ) + if request.tickers: + return await self.add_to_watchlist( + request=UpdateWatchlistRequest(id=watchlist_id, tickers=request.tickers) + ) + return await self.watchlist(request=GetWatchlistRequest(id=watchlist_id)) async def add_to_watchlist(self, request: UpdateWatchlistRequest) -> Watchlist: """Updates a watchlist by adding symbols to it.""" diff --git a/tests/cassettes/test_watchlist/test_add_to_watchlist.yaml b/tests/cassettes/test_watchlist/test_add_to_watchlist.yaml index 73ed63c..8ead21a 100644 --- a/tests/cassettes/test_watchlist/test_add_to_watchlist.yaml +++ b/tests/cassettes/test_watchlist/test_add_to_watchlist.yaml @@ -13,26 +13,25 @@ interactions: string: '{"canTradeOnUnsettledFunds": false, "cpfValue": null, "emailVerified": true, "hasFunded": true, "hasTraded": true, "userId": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", - "username": "rita19", "emailAddress": "torresbenjamin@gmail.com", "dw_AccountId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": "w4-1267174s", - "macAccountNumber": "H1-7641957H", "status": null, "macStatus": "BASIC_USER", - "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": - null, "firstName": "Tammy", "lastName": "Alexander", "phoneNumber": "9011530005", - "signUpPhase": 0, "ackSignedWhen": "2021-05-18", "createdDate": 1574303699770, - "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": - null, "referralCode": "L7-2127933N", "referredByCode": null, "regionIdentifier": + "username": "michael29", "emailAddress": "reevesmegan@gilmore-wright.biz", + "dw_AccountId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": + "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": + "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": + null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": + 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": + null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": null, "userProfile": {"residentialAddress": null, "postalAddress": null}, - "ledgerBalance": 0.0, "investorAccreditations": null, "proscoreStatus": null, - "fxSpeed": "Regular", "facilitaStatus": null, "dateOfBirth": null, "upToDateDetails2021": + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": - null, "documentsStatus": "NO_ACTION", "mfaenabled": false}' + null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": + false}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/user - request: body: null headers: @@ -45,31 +44,33 @@ interactions: response: body: string: - '{"products": [{"id": "b738ff53-b576-4f09-822e-91128def0560", "instrumentTypeID": - null, "symbol": "SPOT", "description": "Spotify Technology SA a Luxembourg-based - company, which offers digital music-streaming services. The Company enables - users to discover new releases, which includes the latest singles and albums; - playlists, which includes ready-made playlists put together by music fans - and experts, and over millions of songs so that users can play their favorites, - discover new tracks and build a personalized collection. Users can either - select Spotify Free, which includes only shuffle play or Spotify Premium, - which encompasses a range of features, such as shuffle play, advertisement - free, unlimited skips, listen offline, play any track and high quality audio. - The Company operates through a number of subsidiaries, including Spotify LTD - and is present in over 20 countries.", "category": "Stock", "currencyID": - null, "urlImage": "https://drivewealth.imgix.net/symbols/spot.png?fit=fillmax&w=125&h=125&bg=FFFFFF", - "sector": null, "name": "Spotify Technology SA", "dailyReturn": -3.32, "dailyReturnPercentage": - -1.57, "lastTraded": 207.55, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 92.8, "yearlyReturnValue": 131.68, "popularity": 9470.0, "watched": 8075, - "news": 0, "bought": 9479, "viewed": 23400, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "spotify-technology-sa-spot", - "period": "YEAR RETURN", "inceptionDate": 1522713600000, "instrumentTags": + '{"products": [{"id": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "stakeInstrumentId": + "732309e2-71df-41c8-89ac-6bdc2b09356a", "instrumentTypeID": null, "symbol": + "SPOT", "description": "Spotify Technology SA a Luxembourg-based company, + which offers digital music-streaming services. The Company enables users to + discover new releases, which includes the latest singles and albums; playlists, + which includes ready-made playlists put together by music fans and experts, + and over millions of songs so that users can play their favorites, discover + new tracks and build a personalized collection. Users can either select Spotify + Free, which includes only shuffle play or Spotify Premium, which encompasses + a range of features, such as shuffle play, advertisement free, unlimited skips, + listen offline, play any track and high quality audio. The Company operates + through a number of subsidiaries, including Spotify LTD and is present in + over 20 countries.", "category": "Stock", "currencyID": null, "urlImage": + "https://drivewealth.imgix.net/symbols/spot.png?fit=fillmax&w=125&h=125&bg=FFFFFF", + "sector": null, "name": "Spotify Technology SA", "prePostMarketDailyReturn": + -0.87, "prePostMarketDailyReturnPercentage": -0.13, "dailyReturn": -5.56, + "dailyReturnPercentage": -0.81, "lastTraded": 682.24, "monthlyReturn": 0.0, + "yearlyReturnPercentage": 92.8, "yearlyReturnValue": 131.68, "popularity": + 9470.0, "watched": 8806, "news": 0, "bought": 14189, "viewed": 26300, "productType": + "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": + "spotify-technology-sa-spot", "period": "YEAR RETURN", "extendedHoursNotionalStatus": + "ACTIVE", "inceptionDate": 1522713600000, "marketCap": 121400901583, "instrumentTags": [], "childInstruments": []}]}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/products/searchProduct?symbol=SPOT&page=1&max=1 - request: body: null headers: @@ -88,5 +89,4 @@ interactions: status: code: 202 message: Accepted - url: https://global-prd-api.hellostake.com/api/instruments/addRemoveInstrumentWatchlist version: 1 diff --git a/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml b/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml index 50bd79c..07cc2ae 100644 --- a/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml +++ b/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml @@ -18,14 +18,13 @@ interactions: "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": - "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2021-11-15", "createdDate": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": null, "userProfile": {"residentialAddress": null, "postalAddress": null}, - "ledgerBalance": 0.0, "investorAccreditations": null, "proscoreStatus": null, - "fxSpeed": "Regular", "facilitaStatus": null, "dateOfBirth": null, "upToDateDetails2021": + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": false}' @@ -33,7 +32,6 @@ interactions: status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/user - request: body: null headers: @@ -46,15 +44,27 @@ interactions: response: body: string: - '{"generated": false, "watchlists": [{"watchlistId": "bb0f59b5-2454-451c-8de3-fa3fc7d13a42", - "name": "Not so much test", "timeCreated": "2022-07-14T05:25:44.881769Z", - "count": 1}, {"watchlistId": "e649db6d-71ab-4649-a32e-59d57def4a00", "name": - "stef 2", "timeCreated": "2022-07-14T05:31:06.054443Z", "count": 0}]}' + '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "watchlist-2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-15", + "timeCreated": "2025-08-15T01:35:39.886173Z", "count": 17}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-18", "timeCreated": + "2025-08-18T02:09:51.269589Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", + "count": 16}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "watchlist-2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-22", + "timeCreated": "2025-08-22T04:34:50.976937Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-23", "timeCreated": + "2025-08-22T21:47:06.609169Z", "count": 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", + "count": 15}]}' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlists - request: body: null headers: @@ -67,18 +77,29 @@ interactions: response: body: string: - '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": - [{"watchlistId": "bb0f59b5-2454-451c-8de3-fa3fc7d13a42", "name": "Not so much - test", "timeCreated": "2022-07-14T05:25:44.881769Z", "count": 1}, {"watchlistId": - "e649db6d-71ab-4649-a32e-59d57def4a00", "name": "stef 2", "timeCreated": "2022-07-14T05:31:06.054443Z", - "count": 0}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "test_watchlist__NYSEUrl", "timeCreated": "2022-07-24T06:28:54.177475Z", "count": - 0}]}' + '{"newWatchlistId": "fa4a4511-920f-45f4-8cb7-9370620d24a4", "watchlists": + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-13", + "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-14", "timeCreated": + "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "watchlist-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-19", + "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-21", "timeCreated": + "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "watchlist-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-26", + "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", + "timeCreated": "2025-09-01T12:36:05.141048Z", "count": 0}]}' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist - request: body: null headers: @@ -87,7 +108,25 @@ interactions: Content-Type: - application/json method: GET - uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4 + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", + "count": 0, "instruments": []}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4 response: body: string: @@ -97,7 +136,6 @@ interactions: status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: null headers: @@ -106,21 +144,22 @@ interactions: Content-Type: - application/json method: POST - uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items + uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4/items response: body: string: '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", - "count": 3, "instruments": [{"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", - "name": "Tesla, Inc.", "symbol": "TSLA"}, {"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", - "name": "Alphabet Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": - "e234cc98-cd08-4b04-a388-fe5c822beea6", "name": "Microsoft Corporation", "symbol": - "MSFT"}]}' + "count": 3, "instruments": [{"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", + "stakeInstrumentId": "9606cf50-41fe-42ea-b489-6da1768bc26e", "name": "Alphabet + Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", + "stakeInstrumentId": "b4889388-1f73-46e5-a865-a68e5fd61ca5", "name": "Tesla, + Inc.", "symbol": "TSLA"}, {"instrumentId": "e234cc98-cd08-4b04-a388-fe5c822beea6", + "stakeInstrumentId": "e3769c0b-456d-49dd-bec5-7a750c146d11", "name": "Microsoft + Corporation", "symbol": "MSFT"}]}' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items - request: body: null headers: @@ -129,21 +168,22 @@ interactions: Content-Type: - application/json method: GET - uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4 response: body: string: '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", - "count": 3, "instruments": [{"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", - "name": "Tesla, Inc.", "symbol": "TSLA"}, {"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", - "name": "Alphabet Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": - "e234cc98-cd08-4b04-a388-fe5c822beea6", "name": "Microsoft Corporation", "symbol": - "MSFT"}]}' + "count": 3, "instruments": [{"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", + "stakeInstrumentId": "9606cf50-41fe-42ea-b489-6da1768bc26e", "name": "Alphabet + Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", + "stakeInstrumentId": "b4889388-1f73-46e5-a865-a68e5fd61ca5", "name": "Tesla, + Inc.", "symbol": "TSLA"}, {"instrumentId": "e234cc98-cd08-4b04-a388-fe5c822beea6", + "stakeInstrumentId": "e3769c0b-456d-49dd-bec5-7a750c146d11", "name": "Microsoft + Corporation", "symbol": "MSFT"}]}' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: null headers: @@ -152,21 +192,22 @@ interactions: Content-Type: - application/json method: GET - uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4 response: body: string: '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", - "count": 3, "instruments": [{"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", - "name": "Tesla, Inc.", "symbol": "TSLA"}, {"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", - "name": "Alphabet Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": - "e234cc98-cd08-4b04-a388-fe5c822beea6", "name": "Microsoft Corporation", "symbol": - "MSFT"}]}' + "count": 3, "instruments": [{"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", + "stakeInstrumentId": "9606cf50-41fe-42ea-b489-6da1768bc26e", "name": "Alphabet + Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", + "stakeInstrumentId": "b4889388-1f73-46e5-a865-a68e5fd61ca5", "name": "Tesla, + Inc.", "symbol": "TSLA"}, {"instrumentId": "e234cc98-cd08-4b04-a388-fe5c822beea6", + "stakeInstrumentId": "e3769c0b-456d-49dd-bec5-7a750c146d11", "name": "Microsoft + Corporation", "symbol": "MSFT"}]}' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: tickers: @@ -179,7 +220,7 @@ interactions: Content-Type: - application/json method: DELETE - uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items + uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4/items response: body: string: @@ -189,7 +230,6 @@ interactions: status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items - request: body: null headers: @@ -198,17 +238,28 @@ interactions: Content-Type: - application/json method: DELETE - uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4 response: body: string: - '[{"watchlistId": "bb0f59b5-2454-451c-8de3-fa3fc7d13a42", "name": "Not - so much test", "timeCreated": "2022-07-14T05:25:44.881769Z", "count": 1}, - {"watchlistId": "e649db6d-71ab-4649-a32e-59d57def4a00", "name": "stef 2", - "timeCreated": "2022-07-14T05:31:06.054443Z", "count": 0}]' + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-13", + "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-14", "timeCreated": + "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "watchlist-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-19", + "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-21", "timeCreated": + "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "watchlist-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-26", + "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}]' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 version: 1 diff --git a/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml b/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml index dcacd83..4ff840a 100644 --- a/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml +++ b/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml @@ -18,14 +18,13 @@ interactions: "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": - "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2021-11-15", "createdDate": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": null, "userProfile": {"residentialAddress": null, "postalAddress": null}, - "ledgerBalance": 0.0, "investorAccreditations": null, "proscoreStatus": null, - "fxSpeed": "Regular", "facilitaStatus": null, "dateOfBirth": null, "upToDateDetails2021": + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": false}' @@ -33,7 +32,6 @@ interactions: status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/user - request: body: null headers: @@ -47,17 +45,25 @@ interactions: body: string: '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "List #1", "count": 7, "timeCreated": "2022-05-27T22:13:19.251101"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Minervini", - "count": 1, "timeCreated": "2022-05-30T06:21:48.134924"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Test List", "count": 0, "timeCreated": - "2022-07-13T04:05:52.149562"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "Stef 3", "count": 3, "timeCreated": "2022-07-14T07:56:40.921637"}]}' + "name": "watchlist-2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-06", + "count": 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-09", "count": + 15, "timeCreated": "2025-08-09T00:40:14.987686"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-13", + "count": 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-21", "count": + 16, "timeCreated": "2025-08-21T01:40:59.486169"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-23", + "count": 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-26", "count": + 16, "timeCreated": "2025-08-26T02:52:58.934391"}]}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlists - request: body: null headers: @@ -70,21 +76,28 @@ interactions: response: body: string: - '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": - [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "List #1", - "count": 7, "timeCreated": "2022-05-27T22:13:19.251101"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Minervini", "count": 1, "timeCreated": - "2022-05-30T06:21:48.134924"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "Test List", "count": 0, "timeCreated": "2022-07-13T04:05:52.149562"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Stef 3", - "count": 3, "timeCreated": "2022-07-14T07:56:40.921637"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", - "count": 0, "timeCreated": "2022-07-24T06:33:04.897381"}]}' + '{"newWatchlistId": "7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd", "watchlists": + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-05", + "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-06", "count": + 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-11", + "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-13", "count": + 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-22", + "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-23", "count": + 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", + "count": 0, "timeCreated": "2025-09-01T12:36:07.629226"}]}' headers: {} status: code: 201 message: Created - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist - request: body: null headers: @@ -93,7 +106,25 @@ interactions: Content-Type: - application/json method: GET - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", + "count": 0, "instruments": []}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd response: body: string: @@ -103,7 +134,6 @@ interactions: status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: null headers: @@ -112,7 +142,7 @@ interactions: Content-Type: - application/json method: POST - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd/items response: body: string: @@ -122,12 +152,11 @@ interactions: {"instrumentId": "WDS.XAU", "name": "Woodside Energy Group Ltd", "symbol": "WDS", "recentAnnouncement": false, "sensitive": false}, {"instrumentId": "COL.XAU", "name": "Coles Group Limited", "symbol": "COL", "recentAnnouncement": - false, "sensitive": false}]}' + true, "sensitive": false}]}' headers: {} status: code: 201 message: Created - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items - request: body: null headers: @@ -136,7 +165,7 @@ interactions: Content-Type: - application/json method: GET - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd response: body: string: @@ -146,12 +175,11 @@ interactions: {"instrumentId": "WDS.XAU", "name": "Woodside Energy Group Ltd", "symbol": "WDS", "recentAnnouncement": false, "sensitive": false}, {"instrumentId": "COL.XAU", "name": "Coles Group Limited", "symbol": "COL", "recentAnnouncement": - false, "sensitive": false}]}' + true, "sensitive": false}]}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: null headers: @@ -160,7 +188,7 @@ interactions: Content-Type: - application/json method: GET - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd response: body: string: @@ -170,12 +198,11 @@ interactions: {"instrumentId": "WDS.XAU", "name": "Woodside Energy Group Ltd", "symbol": "WDS", "recentAnnouncement": false, "sensitive": false}, {"instrumentId": "COL.XAU", "name": "Coles Group Limited", "symbol": "COL", "recentAnnouncement": - false, "sensitive": false}]}' + true, "sensitive": false}]}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: tickers: @@ -188,7 +215,7 @@ interactions: Content-Type: - application/json method: DELETE - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd/items response: body: string: @@ -198,7 +225,6 @@ interactions: status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items - request: body: null headers: @@ -207,20 +233,27 @@ interactions: Content-Type: - application/json method: DELETE - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd response: body: string: - '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "List - #1", "count": 7, "timeCreated": "2022-05-27T22:13:19.251101"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Minervini", "count": 1, "timeCreated": - "2022-05-30T06:21:48.134924"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "Test List", "count": 0, "timeCreated": "2022-07-13T04:05:52.149562"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Stef 3", - "count": 3, "timeCreated": "2022-07-14T07:56:40.921637"}]' + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-05", + "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-06", "count": + 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-11", + "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-13", "count": + 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-22", + "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-23", "count": + 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "watchlist-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}]' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 version: 1 diff --git a/tests/cassettes/test_watchlist/test_list_watchlist.yaml b/tests/cassettes/test_watchlist/test_list_watchlist.yaml index adca02b..a7bef29 100644 --- a/tests/cassettes/test_watchlist/test_list_watchlist.yaml +++ b/tests/cassettes/test_watchlist/test_list_watchlist.yaml @@ -13,266 +13,23 @@ interactions: string: '{"canTradeOnUnsettledFunds": false, "cpfValue": null, "emailVerified": true, "hasFunded": true, "hasTraded": true, "userId": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", - "username": "rita19", "emailAddress": "torresbenjamin@gmail.com", "dw_AccountId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": "w4-1267174s", - "macAccountNumber": "H1-7641957H", "status": null, "macStatus": "BASIC_USER", - "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": - null, "firstName": "Tammy", "lastName": "Alexander", "phoneNumber": "9011530005", - "signUpPhase": 0, "ackSignedWhen": "2021-05-18", "createdDate": 1574303699770, - "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": - null, "referralCode": "L7-2127933N", "referredByCode": null, "regionIdentifier": + "username": "michael29", "emailAddress": "reevesmegan@gilmore-wright.biz", + "dw_AccountId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": + "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": + "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": + null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": + 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": + null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": null, "userProfile": {"residentialAddress": null, "postalAddress": null}, - "ledgerBalance": 0.0, "investorAccreditations": null, "proscoreStatus": null, - "fxSpeed": "Regular", "facilitaStatus": null, "dateOfBirth": null, "upToDateDetails2021": + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": - null, "documentsStatus": "NO_ACTION", "mfaenabled": false}' + null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": + false}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/user - - request: - body: null - headers: - Accept: - - application/json - Content-Type: - - application/json - method: GET - uri: https://global-prd-api.hellostake.com/api/products/productsWatchlist/7c9bbfae-0000-47b7-0000-0e66d868c2cf - response: - body: - string: - '{"instrumentsWatchList": [{"productWatchlistID": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "VMW", "description": "VMware, Inc. is an information technology - (IT) company. The Company is engaged in development and application of virtualization - technologies with x86 server-based computing, separating application software - from the underlying hardware. The Company offers various products, which allow - organizations to manage IT resources across private clouds and multi-cloud, - multi-device environments by leveraging synergies across three product categories: - Software-Defined Data Center (SDDC), Hybrid Cloud Computing and End-User Computing - (EUC). The SDDC is designed to transform and modernize the data center into - an on-demand service that addresses application requirements by abstracting, - pooling and automating the services that are required from the underlying - hardware. The Company provides many storage and availability products to offer - data storage and protection options to all applications running on the vSphere - platform. Its wholly owned subsidiary include Pivotal Software Inc.", "category": - "Stock", "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/vmw.png", - "sector": "Technology", "name": "VMware, Inc.", "dailyReturn": -0.36, "dailyReturnPercentage": - -0.29, "lastTraded": 124.35, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 31.23, "yearlyReturnValue": 34.18, "popularity": 1500.0, "watched": 868, "news": - 0, "bought": 826, "viewed": 2300, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "vmware-inc-vmw", - "period": "YEAR RETURN", "inceptionDate": 1187136000000, "instrumentTags": - ["Cloud Computing", "Applications", "Technology", "Software", "Data Storage"], - "childInstruments": []}, "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", - "instrumentTypeID": null, "symbol": "TWLO", "description": "Twilio Inc. offers - Cloud Communications Platform, which enables developers to build, scale and - operate real-time communications within software applications. The Company''s - platform consists of Programmable Communications Cloud, Super Network and - Business Model for Innovators. Its Programmable Communications Cloud software - enables developers to embed voice, messaging, video and authentication capabilities - into their applications through its Application Programming Interfaces (APIs). - Its Programmable Communications Cloud offers building blocks that enable its - customers to build what they need. Its Programmable Communications Cloud includes - Programmable Voice, Programmable Messaging, Programmable Video and Use Case - APIs. The Super Network is its software layer that allows its customers'' - software to communicate with connected devices globally. It interconnects - with communications networks around the world.", "category": "Stock", "currencyID": - "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/twlo.png", - "sector": "Technology", "name": "Twilio", "dailyReturn": -3.54, "dailyReturnPercentage": - -1.71, "lastTraded": 203.7, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 291.28, "yearlyReturnValue": 269.75, "popularity": 14533.0, "watched": 4521, - "news": 0, "bought": 11271, "viewed": 14900, "productType": "Instrument", - "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "twilio-twlo", - "period": "YEAR RETURN", "inceptionDate": 1466640000000, "instrumentTags": - ["Cloud Computing", "Applications", "Software", "Internet", "Telecommunications"], - "childInstruments": []}, "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", - "instrumentTypeID": null, "symbol": "ATVI", "description": "Activision Blizzard, - Inc. is a developer and publisher of interactive entertainment content and - services. The Company develops and distributes content and services on video - game consoles, personal computers (PC) and mobile devices. Its segments include - Activision Publishing, Inc. (Activision), Blizzard Entertainment, Inc. (Blizzard), - King Digital Entertainment (King) and Other. Activision delivers content through - both premium and free-to-play offerings. It also includes the activities of - the Call of Duty League, a global professional esports league with city-based - teams. Blizzard develops and publishes entertainment software for creating - games. Blizzard also maintains an online gaming service, Blizzard Battle.net - , which facilitates digital distribution of Blizzard content and selected - Activision content, online social connectivity, and the creation of user-generated - content. King delivers content on the mobile platform. Kings\u2019 product - franchise is Candy Crush, a match three franchise.", "category": "Stock", - "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/atvi.png", - "sector": "Technology", "name": "Activision Blizzard, Inc.", "dailyReturn": - -0.18, "dailyReturnPercentage": -0.22, "lastTraded": 82.13, "monthlyReturn": - 0.0, "yearlyReturnPercentage": 53.35, "yearlyReturnValue": 32.18, "popularity": - 1617.0, "watched": 5632, "news": 0, "bought": 7394, "viewed": 18200, "productType": - "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": - "activision-blizzard-inc-atvi", "period": "YEAR RETURN", "inceptionDate": - 751507200000, "instrumentTags": ["Entertainment", "Digital Media", "Internet", - "Gaming"], "childInstruments": []}, "watchedDate": "2019-11-21 20:04:09.76"}, - {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "product": - {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": null, "symbol": - "LI", "description": "Li Auto Inc is a China-based holding company engaged - in design, development, manufacturing and sales of smart electric sport utility - vehicles (SUVs). The Company\u2019s primary product is the SUVs under its - brand Li ONE. It also sells peripheral products and provides related services, - such as charging stalls, vehicle internet connection services and extended - lifetime warranties. The Company operates its businesses through its subsidiaries - and variable interest entities (VIEs) in China. ", "category": "Stock", "currencyID": - null, "urlImage": "https://drivewealth.imgix.net/symbols/li.png?fit=fillmax&w=125&h=125&bg=FFFFFF", - "sector": null, "name": "Li Auto Inc", "dailyReturn": -1.18, "dailyReturnPercentage": - -3.87, "lastTraded": 29.29, "monthlyReturn": 0.0, "yearlyReturnPercentage": - null, "yearlyReturnValue": null, "popularity": 14417.0, "watched": 3908, "news": - 0, "bought": 12736, "viewed": 11346, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "li-auto-inc-li", - "period": "YEAR RETURN", "inceptionDate": null, "instrumentTags": ["Vehicle", - "China", "Electric", "Renewable Energy", "Electric Cars"], "childInstruments": - []}, "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "PEAK", "description": "Healthpeak Properties, Inc., formerly - HCP, Inc., is a diversified real estate investment trust, which invests in - real estate serving the healthcare industry in the United States. The Company - acquires, develops, leases, owns and manages healthcare real estate facilities. - The Company''s segments include senior housing triple-net, senior housing - operating portfolio (SHOP), life science and medical office. Its senior housing - facilities include independent living facilities, assisted living facilities, - memory care facilities, care homes, and continuing care retirement communities. - Its Life science properties contain laboratory and office space for biotechnology, - medical device and pharmaceutical companies, scientific research institutions, - government agencies and other organizations. Its Medical office buildings - include physicians'' offices and examination rooms.", "category": "Stock", - "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/hcp.png", - "sector": "Real Estate", "name": "Healthpeak Properties, Inc.", "dailyReturn": - -0.34, "dailyReturnPercentage": -0.94, "lastTraded": 35.74, "monthlyReturn": - 0.0, "yearlyReturnPercentage": -0.84, "yearlyReturnValue": -0.26, "popularity": - 0.0, "watched": 157, "news": 0, "bought": 154, "viewed": 416, "productType": - "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": - "healthpeak-properties-inc-peak", "period": "YEAR RETURN", "inceptionDate": - 563068800000, "instrumentTags": ["Laboratories", "Real Estate", "Healthcare", - "Medical", "Investment"], "childInstruments": []}, "watchedDate": "2019-11-21 - 20:04:09.76"}, {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "MGNX", "description": "MacroGenics, Inc. is a clinical-stage - biopharmaceutical company focused on discovering and developing monoclonal - antibody-based therapeutics for the treatment of cancer, as well as various - autoimmune disorders and infectious diseases. The Company develops therapeutic - product candidates using its antibody-based technology platforms and also - in collaboration with other biopharmaceutical companies. It has a pipeline - of product candidates in human clinical testing, primarily as treatments for - different types of cancers, which are created using its technology platforms. - Its clinical product candidate, margetuximab, has been enhanced using its - Fc Optimization platform. The Company is also developing several product candidates - targeting B7-H3, a protein in the B7 family of immune regulator proteins. - The Company''s product candidates also include enoblituzumab and MGD009, MGC018, - MGD006 (flotetuzumab), MGD007, MGD011 (duvortuxizumab), PF-06671008 and MGD010.", - "category": "Stock", "currencyID": null, "urlImage": "https://drivewealth.imgix.net/symbols/mgnx.png?fit=fillmax&w=125&h=125&bg=FFFFFF", - "sector": null, "name": "MacroGenics, Inc.", "dailyReturn": -0.1, "dailyReturnPercentage": - -0.75, "lastTraded": 13.28, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 272.93, "yearlyReturnValue": 19.76, "popularity": 25605.0, "watched": 202, - "news": 0, "bought": 342, "viewed": 1398, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "macrogenics-inc-mgnx", - "period": "YEAR RETURN", "inceptionDate": 1381449600000, "instrumentTags": - ["Therapeutics", "Research", "Biomedical", "Pharmaceuticals"], "childInstruments": - []}, "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "VIXY", "description": "The investment seeks to provide investment - results (before fees and expenses) that match the performance of the S&P 500 - VIX Short-Term Futures Index. The fund intends to obtain exposure to its index - by investing in futures contracts based on the Chicago Board Options Exchange - (\u201cCBOE\u201d) Volatility Index. It also holds cash or cash equivalents - such as U.S. Treasury securities or other high credit quality short-term fixed-income - or similar securities (such as shares of money market funds, bank deposits, - bank money market accounts, certain variable rate-demand notes and collateralized - repurchase agreements) that may be used as margin for the futures contracts.", - "category": "ETF", "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/vixy.png", - "sector": null, "name": "VIX Short-Term Futures ProShares", "dailyReturn": - 0.24, "dailyReturnPercentage": 1.48, "lastTraded": 16.48, "monthlyReturn": - 0.0, "yearlyReturnPercentage": -59.03, "yearlyReturnValue": -18.3, "popularity": - 11385.0, "watched": 1501, "news": 0, "bought": 3370, "viewed": 12200, "productType": - "Instrument", "exchange": null, "status": "ACTIVE", "type": "ETF", "encodedName": - "vix-shortterm-futures-proshares-vixy", "period": "YEAR RETURN", "inceptionDate": - 1294099200000, "instrumentTags": ["Short Term", "VIX", "Futures", "ETF", "Short"], - "childInstruments": []}, "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", - "instrumentTypeID": null, "symbol": "DOCU", "description": "DocuSign Inc offers - DocuSign Agreement Cloud, a software suite for automating the agreement process. - It includes DocuSign eSignature, an electronic signature solution that allows - an agreement to be signed electronically on a variety of devices. The Agreement - Cloud also includes several other applications for automating pre- and post-signature - processes, such as automatically generating an agreement from data in other - systems, supporting negotiation workflow, collecting payment after signatures, - and using artificial intelligence (AI) to analyze a collection of agreements - for risks and opportunities. The Agreement Cloud also includes hundreds of - integrations to other systems, so agreement processes can integrate with other - business processes and data. Its key Agreement Cloud products include DocuSign - Contract Lifecycle Management (CLM), Intelligent Insights, Gen for Salesforce, - Negotiate for Salesforce, Guided Forms, Click, Identify, Standards-Based Signatures, - Payments and eNotary.", "category": "Stock", "currencyID": null, "urlImage": - "https://drivewealth.imgix.net/symbols/docu.png?fit=fillmax&w=125&h=125&bg=FFFFFF", - "sector": null, "name": "DocuSign, Inc. ", "dailyReturn": -0.34, "dailyReturnPercentage": - -0.27, "lastTraded": 126.97, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 167.13, "yearlyReturnValue": 133.4, "popularity": 21780.0, "watched": 4311, - "news": 0, "bought": 9711, "viewed": 12500, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "docusign-inc-docu", - "period": "YEAR RETURN", "inceptionDate": null, "instrumentTags": ["Cloud - Computing", "Digital Media", "Cloud", "Software"], "childInstruments": []}, - "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "TEAM", "description": "Atlassian Corporation Plc is a holding - company. The Company offers a range of team collaboration products. The Company - offers products, including JIRA, Confluence, HipChat, Bitbucket and JIRA Service - Desk, for software developers, information technology (IT) managers and knowledge - workers. The Company offers JIRA for team planning and project management; - Confluence for team content creation and sharing; HipChat for team real-time - messaging and communications; Bitbucket for team code sharing and management, - and JIRA Service Desk for team service and support applications. JIRA allows - teams to organize their work into projects and customize dashboards for those - projects to keep their teams aligned and on track. Confluence provides a system - for organizing, sharing and securing content in spaces arranged by team, project, - department and others. The Company also offers additional tools for software - developers, such as FishEye, Clover, Crowd, Crucible, Bamboo and SourceTree.", - "category": "Stock", "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/team.png", - "sector": "Technology", "name": "Atlassian Corporation Plc", "dailyReturn": - 0.78, "dailyReturnPercentage": 0.27, "lastTraded": 294.41, "monthlyReturn": - 0.0, "yearlyReturnPercentage": 71.88, "yearlyReturnValue": 97.46, "popularity": - 13430.0, "watched": 7786, "news": 0, "bought": 14188, "viewed": 40600, "productType": - "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": - "atlassian-corporation-plc-team", "period": "YEAR RETURN", "inceptionDate": - 1449619200000, "instrumentTags": ["Computers", "Disruptors", "Asia Pacific", - "Software", "Australia"], "childInstruments": []}, "watchedDate": "2019-11-21 - 20:04:09.76"}, {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "MSFT", "description": "Microsoft Corporation is a technology - company. The Company develops, licenses, and supports a range of software - products, services and devices. The Company''s segments include Productivity - and Business Processes, Intelligent Cloud and More Personal Computing. The - Company''s products include operating systems; cross-device productivity applications; - server applications; business solution applications; desktop and server management - tools; software development tools; video games, and training and certification - of computer system integrators and developers. It also designs, manufactures, - and sells devices, including personal computers (PCs), tablets, gaming and - entertainment consoles, phones, other intelligent devices, and related accessories, - that integrate with its cloud-based offerings. It offers an array of services, - including cloud-based solutions that provide customers with software, services, - platforms, and content, and it provides solution support and consulting services.", - "category": "Stock", "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/msft.png", - "sector": "Technology", "name": "Microsoft Corporation", "dailyReturn": 1.19, - "dailyReturnPercentage": 0.39, "lastTraded": 303.84, "monthlyReturn": 0.0, - "yearlyReturnPercentage": 46.75, "yearlyReturnValue": 74.48, "popularity": - 1717.0, "watched": 31760, "news": 0, "bought": 75929, "viewed": 88100, "productType": - "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": - "microsoft-corporation-msft", "period": "YEAR RETURN", "inceptionDate": 511056000000, - "instrumentTags": ["Cloud Computing", "Applications", "Technology", "Software", - "Bill Gates"], "childInstruments": []}, "watchedDate": "2019-11-21 20:04:09.76"}]}' - headers: {} - status: - code: 200 - message: OK - url: https://global-prd-api.hellostake.com/api/products/productsWatchlist/7c9bbfae-0000-47b7-0000-0e66d868c2cf version: 1 diff --git a/tests/cassettes/test_watchlist/test_remove_from_watchlist.yaml b/tests/cassettes/test_watchlist/test_remove_from_watchlist.yaml index 620707e..06dd183 100644 --- a/tests/cassettes/test_watchlist/test_remove_from_watchlist.yaml +++ b/tests/cassettes/test_watchlist/test_remove_from_watchlist.yaml @@ -13,26 +13,25 @@ interactions: string: '{"canTradeOnUnsettledFunds": false, "cpfValue": null, "emailVerified": true, "hasFunded": true, "hasTraded": true, "userId": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", - "username": "rita19", "emailAddress": "torresbenjamin@gmail.com", "dw_AccountId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": "w4-1267174s", - "macAccountNumber": "H1-7641957H", "status": null, "macStatus": "BASIC_USER", - "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": - null, "firstName": "Tammy", "lastName": "Alexander", "phoneNumber": "9011530005", - "signUpPhase": 0, "ackSignedWhen": "2021-05-18", "createdDate": 1574303699770, - "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": - null, "referralCode": "L7-2127933N", "referredByCode": null, "regionIdentifier": + "username": "michael29", "emailAddress": "reevesmegan@gilmore-wright.biz", + "dw_AccountId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": + "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": + "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": + null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": + 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": + null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": null, "userProfile": {"residentialAddress": null, "postalAddress": null}, - "ledgerBalance": 0.0, "investorAccreditations": null, "proscoreStatus": null, - "fxSpeed": "Regular", "facilitaStatus": null, "dateOfBirth": null, "upToDateDetails2021": + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": - null, "documentsStatus": "NO_ACTION", "mfaenabled": false}' + null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": + false}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/user - request: body: null headers: @@ -45,31 +44,33 @@ interactions: response: body: string: - '{"products": [{"id": "93b3755d-0e2d-4d83-8f3b-ddd52cefaeee", "instrumentTypeID": - null, "symbol": "SPOT", "description": "Spotify Technology SA a Luxembourg-based - company, which offers digital music-streaming services. The Company enables - users to discover new releases, which includes the latest singles and albums; - playlists, which includes ready-made playlists put together by music fans - and experts, and over millions of songs so that users can play their favorites, - discover new tracks and build a personalized collection. Users can either - select Spotify Free, which includes only shuffle play or Spotify Premium, - which encompasses a range of features, such as shuffle play, advertisement - free, unlimited skips, listen offline, play any track and high quality audio. - The Company operates through a number of subsidiaries, including Spotify LTD - and is present in over 20 countries.", "category": "Stock", "currencyID": - null, "urlImage": "https://drivewealth.imgix.net/symbols/spot.png?fit=fillmax&w=125&h=125&bg=FFFFFF", - "sector": null, "name": "Spotify Technology SA", "dailyReturn": -3.32, "dailyReturnPercentage": - -1.57, "lastTraded": 207.55, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 92.8, "yearlyReturnValue": 131.68, "popularity": 9470.0, "watched": 8075, - "news": 0, "bought": 9479, "viewed": 23400, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "spotify-technology-sa-spot", - "period": "YEAR RETURN", "inceptionDate": 1522713600000, "instrumentTags": + '{"products": [{"id": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "stakeInstrumentId": + "732309e2-71df-41c8-89ac-6bdc2b09356a", "instrumentTypeID": null, "symbol": + "SPOT", "description": "Spotify Technology SA a Luxembourg-based company, + which offers digital music-streaming services. The Company enables users to + discover new releases, which includes the latest singles and albums; playlists, + which includes ready-made playlists put together by music fans and experts, + and over millions of songs so that users can play their favorites, discover + new tracks and build a personalized collection. Users can either select Spotify + Free, which includes only shuffle play or Spotify Premium, which encompasses + a range of features, such as shuffle play, advertisement free, unlimited skips, + listen offline, play any track and high quality audio. The Company operates + through a number of subsidiaries, including Spotify LTD and is present in + over 20 countries.", "category": "Stock", "currencyID": null, "urlImage": + "https://drivewealth.imgix.net/symbols/spot.png?fit=fillmax&w=125&h=125&bg=FFFFFF", + "sector": null, "name": "Spotify Technology SA", "prePostMarketDailyReturn": + -0.87, "prePostMarketDailyReturnPercentage": -0.13, "dailyReturn": -5.56, + "dailyReturnPercentage": -0.81, "lastTraded": 682.24, "monthlyReturn": 0.0, + "yearlyReturnPercentage": 92.8, "yearlyReturnValue": 131.68, "popularity": + 9470.0, "watched": 8806, "news": 0, "bought": 14189, "viewed": 26300, "productType": + "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": + "spotify-technology-sa-spot", "period": "YEAR RETURN", "extendedHoursNotionalStatus": + "ACTIVE", "inceptionDate": 1522713600000, "marketCap": 121400901583, "instrumentTags": [], "childInstruments": []}]}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/products/searchProduct?symbol=SPOT&page=1&max=1 - request: body: null headers: @@ -88,5 +89,4 @@ interactions: status: code: 202 message: Accepted - url: https://global-prd-api.hellostake.com/api/instruments/addRemoveInstrumentWatchlist version: 1 diff --git a/tests/test_watchlist.py b/tests/test_watchlist.py index 286e051..ad070a6 100644 --- a/tests/test_watchlist.py +++ b/tests/test_watchlist.py @@ -4,40 +4,11 @@ import stake from stake import constant from stake.watchlist import ( - AddToWatchlistRequest, CreateWatchlistRequest, DeleteWatchlistRequest, - RemoveFromWatchlistRequest, UpdateWatchlistRequest, - Watchlist, ) -# flake8: noqa - - -@pytest.mark.vcr() -@pytest.mark.asyncio -async def test_add_to_watchlist(tracing_client: stake.StakeClient): - added = await tracing_client.watchlist.add(AddToWatchlistRequest(symbol="SPOT")) - assert added.watching - - -@pytest.mark.vcr() -@pytest.mark.asyncio -async def test_remove_from_watchlist(tracing_client: stake.StakeClient): - - removed = await tracing_client.watchlist.remove( - RemoveFromWatchlistRequest(symbol="SPOT") - ) - assert not removed.watching - - -@pytest.mark.vcr() -@pytest.mark.asyncio -async def test_list_watchlist(tracing_client: stake.StakeClient): - watched = await tracing_client.watchlist.list() - assert len(watched) == 10 - @pytest.mark.parametrize( "exchange, symbols", From 30c2078f7eaee306e7efdea4f7db6c45a95c9c3f Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 1 Sep 2025 22:46:08 +1000 Subject: [PATCH 09/11] Updated tests --- ..._create_watchlist[exchange0-symbols0].yaml | 72 +++++++++---------- ..._create_watchlist[exchange1-symbols1].yaml | 72 +++++++++---------- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml b/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml index 07cc2ae..d6ce4f6 100644 --- a/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml +++ b/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml @@ -45,21 +45,21 @@ interactions: body: string: '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", + "name": "test--2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "watchlist-2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": - 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-15", + "test--2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", "count": 17}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-18", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", + "name": "test--2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "watchlist-2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": - 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-22", + "test--2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", "count": 15}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-23", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", + "name": "test--2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}]}' headers: {} status: @@ -77,25 +77,25 @@ interactions: response: body: string: - '{"newWatchlistId": "fa4a4511-920f-45f4-8cb7-9370620d24a4", "watchlists": - [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-13", + '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-14", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "name": "test--2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "watchlist-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": - 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-19", + "test--2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-21", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "name": "test--2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "watchlist-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": - 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-26", + "test--2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", - "timeCreated": "2025-09-01T12:36:05.141048Z", "count": 0}]}' + "timeCreated": "2025-09-01T12:43:47.947856Z", "count": 0}]}' headers: {} status: code: 200 @@ -108,7 +108,7 @@ interactions: Content-Type: - application/json method: GET - uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4 + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 response: body: string: @@ -126,7 +126,7 @@ interactions: Content-Type: - application/json method: GET - uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4 + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 response: body: string: @@ -144,7 +144,7 @@ interactions: Content-Type: - application/json method: POST - uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4/items + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items response: body: string: @@ -168,7 +168,7 @@ interactions: Content-Type: - application/json method: GET - uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4 + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 response: body: string: @@ -192,7 +192,7 @@ interactions: Content-Type: - application/json method: GET - uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4 + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 response: body: string: @@ -220,7 +220,7 @@ interactions: Content-Type: - application/json method: DELETE - uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4/items + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items response: body: string: @@ -238,25 +238,25 @@ interactions: Content-Type: - application/json method: DELETE - uri: https://api.prd.stakeover.io/us/instrument/watchlist/fa4a4511-920f-45f4-8cb7-9370620d24a4 + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 response: body: string: - '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-13", + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-14", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "name": "test--2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "watchlist-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": - 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-19", + "test--2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-21", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "name": "test--2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "watchlist-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": - 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-26", + "test--2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}]' headers: {} status: diff --git a/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml b/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml index 4ff840a..de548df 100644 --- a/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml +++ b/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml @@ -45,20 +45,20 @@ interactions: body: string: '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-06", + "name": "test--2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-06", "count": 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-09", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-13", + "name": "test--2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-13", "count": 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-21", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-23", + "name": "test--2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-23", "count": 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-26", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}]}' headers: {} status: @@ -76,24 +76,24 @@ interactions: response: body: string: - '{"newWatchlistId": "7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd", "watchlists": - [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-05", + '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-06", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-06", "count": 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-11", + "name": "test--2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-13", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-13", "count": 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-22", + "name": "test--2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-23", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-23", "count": 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}, + "name": "test--2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", - "count": 0, "timeCreated": "2025-09-01T12:36:07.629226"}]}' + "count": 0, "timeCreated": "2025-09-01T12:43:50.131385"}]}' headers: {} status: code: 201 @@ -106,7 +106,7 @@ interactions: Content-Type: - application/json method: GET - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 response: body: string: @@ -124,7 +124,7 @@ interactions: Content-Type: - application/json method: GET - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 response: body: string: @@ -142,7 +142,7 @@ interactions: Content-Type: - application/json method: POST - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd/items + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items response: body: string: @@ -165,7 +165,7 @@ interactions: Content-Type: - application/json method: GET - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 response: body: string: @@ -188,7 +188,7 @@ interactions: Content-Type: - application/json method: GET - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 response: body: string: @@ -215,7 +215,7 @@ interactions: Content-Type: - application/json method: DELETE - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd/items + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items response: body: string: @@ -233,25 +233,25 @@ interactions: Content-Type: - application/json method: DELETE - uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/7f3f4fd8-6fbf-4cc1-8beb-49bc807e90fd + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 response: body: string: - '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-05", + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-06", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-06", "count": 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-11", + "name": "test--2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-13", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-13", "count": 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-22", + "name": "test--2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "watchlist-2025-08-23", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-23", "count": 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "watchlist-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}]' + "name": "test--2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}]' headers: {} status: code: 200 From 39e69e8587d6c2f5e50b037c4c5c1a6abbe4290c Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 1 Sep 2025 23:08:38 +1000 Subject: [PATCH 10/11] Updated tests --- ..._create_watchlist[exchange0-symbols0].yaml | 56 +++++++++---------- ..._create_watchlist[exchange1-symbols1].yaml | 56 +++++++++---------- tests/test_watchlist.py | 28 ++++++++++ 3 files changed, 84 insertions(+), 56 deletions(-) diff --git a/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml b/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml index d6ce4f6..d445e35 100644 --- a/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml +++ b/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml @@ -45,21 +45,21 @@ interactions: body: string: '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", + "name": "test-2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "test--2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": - 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-15", + "test-2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", "count": 17}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-18", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", + "name": "test-2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "test--2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": - 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-22", + "test-2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", "count": 15}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-23", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", + "name": "test-2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}]}' headers: {} status: @@ -78,24 +78,24 @@ interactions: body: string: '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": - [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-13", + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-14", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "name": "test-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "test--2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": - 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-19", + "test-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-21", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "name": "test-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "test--2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": - 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-26", + "test-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", - "timeCreated": "2025-09-01T12:43:47.947856Z", "count": 0}]}' + "timeCreated": "2025-09-01T13:05:45.299653Z", "count": 0}]}' headers: {} status: code: 200 @@ -242,21 +242,21 @@ interactions: response: body: string: - '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-13", + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-14", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "name": "test-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "test--2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": - 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-19", + "test-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-21", "timeCreated": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "name": "test-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "test--2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": - 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-26", + "test-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}]' headers: {} status: diff --git a/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml b/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml index de548df..c9af90b 100644 --- a/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml +++ b/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml @@ -45,20 +45,20 @@ interactions: body: string: '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-06", + "name": "test-2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", "count": 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-09", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-13", + "name": "test-2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "count": 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-21", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-23", + "name": "test-2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "count": 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-26", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}]}' headers: {} status: @@ -77,23 +77,23 @@ interactions: body: string: '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": - [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-05", + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-06", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", "count": 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-11", + "name": "test-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-13", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "count": 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-22", + "name": "test-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-23", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "count": 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}, + "name": "test-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", - "count": 0, "timeCreated": "2025-09-01T12:43:50.131385"}]}' + "count": 0, "timeCreated": "2025-09-01T13:05:47.428516"}]}' headers: {} status: code: 201 @@ -237,21 +237,21 @@ interactions: response: body: string: - '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-05", + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-06", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", "count": 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-11", + "name": "test-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-13", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "count": 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-22", + "name": "test-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test--2025-08-23", "count": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "count": 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "test--2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}]' + "name": "test-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}]' headers: {} status: code: 200 diff --git a/tests/test_watchlist.py b/tests/test_watchlist.py index ad070a6..3790942 100644 --- a/tests/test_watchlist.py +++ b/tests/test_watchlist.py @@ -54,3 +54,31 @@ async def test_create_watchlist( request=DeleteWatchlistRequest(id=update_request.id) ) assert result + + +@pytest.mark.parametrize( + "exchange, symbols", + ( + (constant.NYSE, ["TSLA", "GOOG", "MSFT", "NOK"]), + (constant.ASX, ["COL", "WDS", "BHP", "OOO"]), + ), +) +@pytest.mark.vcr() +@pytest.mark.asyncio +async def test_create_watchlist_with_tickers( + tracing_client: stake.StakeClient, exchange: BaseModel, symbols: str +): + name = f"test_watchlist__{exchange.__class__.__name__}" + tracing_client.set_exchange(exchange) + watched = await tracing_client.watchlist.create_watchlist( + CreateWatchlistRequest(name=name, tickers=symbols) + ) + if not watched: + return + + assert watched.count == len(symbols) + + result = await tracing_client.watchlist.delete_watchlist( + request=DeleteWatchlistRequest(id=watched.watchlist_id) + ) + assert result From 54505c3dc370104c23c7ed95418714227e204603 Mon Sep 17 00:00:00 2001 From: Stefano Tabacco Date: Mon, 1 Sep 2025 23:12:08 +1000 Subject: [PATCH 11/11] Added missing cassettes --- ...list_with_tickers[exchange0-symbols0].yaml | 179 ++++++++++++++++++ ...list_with_tickers[exchange1-symbols1].yaml | 175 +++++++++++++++++ 2 files changed, 354 insertions(+) create mode 100644 tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange0-symbols0].yaml create mode 100644 tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange1-symbols1].yaml diff --git a/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange0-symbols0].yaml b/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange0-symbols0].yaml new file mode 100644 index 0000000..1f7b9bc --- /dev/null +++ b/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange0-symbols0].yaml @@ -0,0 +1,179 @@ +interactions: + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://global-prd-api.hellostake.com/api/user + response: + body: + string: + '{"canTradeOnUnsettledFunds": false, "cpfValue": null, "emailVerified": + true, "hasFunded": true, "hasTraded": true, "userId": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", + "username": "michael29", "emailAddress": "reevesmegan@gilmore-wright.biz", + "dw_AccountId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": + "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": + "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": + null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": + 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": + null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": + "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": + null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": + null, "userProfile": {"residentialAddress": null, "postalAddress": null}, + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": + "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": + null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": + false}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://api.prd.stakeover.io/us/instrument/watchlists + response: + body: + string: + '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-15", + "timeCreated": "2025-08-15T01:35:39.886173Z", "count": 17}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-18", "timeCreated": + "2025-08-18T02:09:51.269589Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", + "count": 16}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", + "timeCreated": "2025-08-22T04:34:50.976937Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "timeCreated": + "2025-08-22T21:47:06.609169Z", "count": 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", + "count": 15}]}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.prd.stakeover.io/us/instrument/watchlist + response: + body: + string: + '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", + "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-14", "timeCreated": + "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-19", + "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "timeCreated": + "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", + "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", + "timeCreated": "2025-09-01T13:05:48.891648Z", "count": 0}]}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", + "count": 0, "instruments": []}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", + "count": 4, "instruments": [{"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", + "stakeInstrumentId": "9606cf50-41fe-42ea-b489-6da1768bc26e", "name": "Alphabet + Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": "5772f238-235d-40c2-9053-c13815fee7eb", + "stakeInstrumentId": "b19da77b-0d19-420d-9a63-26b697182773", "name": "Nokia + Corp.", "symbol": "NOK"}, {"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", + "stakeInstrumentId": "b4889388-1f73-46e5-a865-a68e5fd61ca5", "name": "Tesla, + Inc.", "symbol": "TSLA"}, {"instrumentId": "e234cc98-cd08-4b04-a388-fe5c822beea6", + "stakeInstrumentId": "e3769c0b-456d-49dd-bec5-7a750c146d11", "name": "Microsoft + Corporation", "symbol": "MSFT"}]}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: DELETE + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + response: + body: + string: + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", + "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-14", "timeCreated": + "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-19", + "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "timeCreated": + "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", + "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}]' + headers: {} + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange1-symbols1].yaml b/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange1-symbols1].yaml new file mode 100644 index 0000000..6f70849 --- /dev/null +++ b/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange1-symbols1].yaml @@ -0,0 +1,175 @@ +interactions: + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://global-prd-api.hellostake.com/api/user + response: + body: + string: + '{"canTradeOnUnsettledFunds": false, "cpfValue": null, "emailVerified": + true, "hasFunded": true, "hasTraded": true, "userId": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", + "username": "michael29", "emailAddress": "reevesmegan@gilmore-wright.biz", + "dw_AccountId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": + "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": + "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": + null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": + 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": + null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": + "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": + null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": + null, "userProfile": {"residentialAddress": null, "postalAddress": null}, + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": + "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": + null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": + false}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlists + response: + body: + string: + '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", + "count": 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-09", "count": + 15, "timeCreated": "2025-08-09T00:40:14.987686"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", + "count": 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "count": + 16, "timeCreated": "2025-08-21T01:40:59.486169"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", + "count": 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", "count": + 16, "timeCreated": "2025-08-26T02:52:58.934391"}]}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist + response: + body: + string: + '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-05", + "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", "count": + 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-11", + "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "count": + 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", + "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "count": + 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", + "count": 0, "timeCreated": "2025-09-01T13:05:50.279057"}]}' + headers: {} + status: + code: 201 + message: Created + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", + "count": 0, "instruments": []}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", + "count": 4, "instruments": [{"instrumentId": "OOO.XAU", "name": "BetaShares + Crude Oil Index ETF-Currency Hedged (Synthetic)", "symbol": "OOO", "recentAnnouncement": + false, "sensitive": false}, {"instrumentId": "BHP.XAU", "name": "BHP Group + Limited", "symbol": "BHP", "recentAnnouncement": false, "sensitive": false}, + {"instrumentId": "WDS.XAU", "name": "Woodside Energy Group Ltd", "symbol": + "WDS", "recentAnnouncement": false, "sensitive": false}, {"instrumentId": + "COL.XAU", "name": "Coles Group Limited", "symbol": "COL", "recentAnnouncement": + true, "sensitive": false}]}' + headers: {} + status: + code: 201 + message: Created + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: DELETE + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + response: + body: + string: + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-05", + "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", "count": + 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-11", + "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "count": + 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", + "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "count": + 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}]' + headers: {} + status: + code: 200 + message: OK +version: 1