wgc-mocks
Full mock server for the WGC QA framework. Emulates all external services that Wargaming Game Center communicates with, including authentication (WGNI), commerce (WGCPS), content (CHUB API), and Steam integration.
Architecture
GameMocks (aiohttp async server)
├── HTTP :8888
├── HTTPS :7771
│
├── WGNI (Wargaming Network Identity)
│ ├── OAuth token create/verify/revoke
│ ├── Account info (v2, v3)
│ ├── Two-factor authentication
│ ├── Challenge/captcha
│ └── Game ticket issue/consume
│
├── WGNR (Registration)
│ ├── Basic account creation
│ ├── Demo account creation
│ ├── Steam registration
│ └── Account activation
│
├── WGNP (Personal)
│ ├── Nickname change/validation
│ ├── Teleport (realm transfer)
│ ├── Signature management
│ └── Credentials management
│
├── WGCPS (Commerce)
│ ├── Product list (personal/global)
│ ├── Storefront categories
│ ├── Purchase prepare/commit
│ ├── Payment methods
│ ├── Bonus code redemption
│ ├── Notifications
│ └── Game page categories
│
├── CHUB API (Content)
│ ├── Content feed
│ ├── Game resources
│ └── Pages
│
├── Agate (Steam)
│ ├── Steam external payment init
│ └── Steam external payment commit
│
└── Update Service
├── Game patches / metadata
└── Torrent files
Usage
from wgc_mocks import GameMocks
# Start mock server
await GameMocks.start()
# Mock handlers are swappable for testing error scenarios:
original = GameMocks.get_game_patch
async def error_handler(request):
return web.Response(status=503)
GameMocks.get_game_patch = error_handler
# Restore
GameMocks.get_game_patch = original
WGNIUsersDB — in-memory user database
from wgc_mocks.wgni import WGNIUsersDB
# User management for mock auth
WGNIUsersDB.create_user(email='test@test.com', password='pass123')
user = WGNIUsersDB.get_user_by_email('test@test.com')
Key Features
- Hot-swappable handlers — replace any mock handler in fixtures to simulate errors
- Self-signed HTTPS — supports both HTTP and HTTPS with bundled certificates
- WebSocket proxy — forwards WebSocket messages between test and WGC
- Stateful — maintains user sessions, tokens, purchase state across requests
- 60+ API routes mocked across WGNI, WGCPS, CHUB, and Agate
Install
pip install wgc-mocks
Dependencies
wgc-core— config, logger, exceptionswgc-helpers— OS helpers, encryption, certificateswgc-clippy— utilitiesaiohttp— async HTTP servernest-asyncio— nested event loop support
Metadata
Release files for wgc-mocks 4.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wgc_mocks-4.0.3.tar.gz | 1.9 MB | Without provenance | Details for wgc_mocks-4.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wgc_mocks-4.0.3-py3-none-any.whl | Python 3 | none | any | Details for wgc_mocks-4.0.3-py3-none-any.whl |
Total release size: 3.9 MB
Release files / wgc_mocks-4.0.3.tar.gz
| Download URL | wgc_mocks-4.0.3.tar.gz |
|---|---|
| Size | 1.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f3f2230eb0bd8c0d15206069d4cef2941c1a3a7d81eae8058fcc8203cb49899
|
|
BLAKE2b-256 checksum How to use checksums |
8b49a7071843bc616eb628198347229a7eaa4753b04ce789681d22c8669442f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / wgc_mocks-4.0.3-py3-none-any.whl
| Download URL | wgc_mocks-4.0.3-py3-none-any.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63ce51e7e8705bcd769b55e651d07d249a124c79e92002ce0cadc047ebdea2f6
|
|
BLAKE2b-256 checksum How to use checksums |
0dea2584d360be484e9543cf95ec2a2b2adb6d355661df9def3e1f3a65d069cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for wgc-mocks 4.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.