Add tests subpackage. Add TestRestSerializersAndTypes and TestWebsocketSerializersAndTypes unit tests. Fix consistency bugs between serializers and types.

This commit is contained in:
Davide Casale
2023-02-01 17:05:25 +01:00
parent 40a48184da
commit 05784cc8ec
8 changed files with 125 additions and 5 deletions

View File

@@ -6,12 +6,32 @@ from .. labeler import _Type
from .. notification import Notification
from .. utils.encoder import JSON
__types__ = [
"PlatformStatus", "TradingPairTicker", "FundingCurrencyTicker",
"TickersHistory", "TradingPairTrade", "FundingCurrencyTrade",
"TradingPairBook", "FundingCurrencyBook", "TradingPairRawBook",
"FundingCurrencyRawBook", "Statistic", "Candle",
"DerivativesStatus", "Liquidation", "Leaderboard",
"FundingStatistic", "PulseProfile", "PulseMessage",
"TradingMarketAveragePrice", "FundingMarketAveragePrice", "FxRate",
"Order", "Position", "Trade",
"FundingTrade", "OrderTrade", "Ledger",
"FundingOffer", "FundingCredit", "FundingLoan",
"FundingAutoRenew", "FundingInfo", "Wallet",
"Transfer", "Withdrawal", "DepositAddress",
"Invoice", "Movement", "SymbolMarginInfo",
"BaseMarginInfo", "Claim", "IncreaseInfo",
"Increase", "PositionHistory", "PositionSnapshot",
"PositionAudit", "DerivativePositionCollateral", "DerivativePositionCollateralLimits",
]
#region Type hinting for Rest Public Endpoints
@dataclass
class PlatformStatus(_Type):
status: int
@dataclass
class TradingPairTicker(_Type):
symbol: Optional[str]