Skip to main content

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, exceptions
  • wgc-helpers — OS helpers, encryption, certificates
  • wgc-clippy — utilities
  • aiohttp — async HTTP server
  • nest-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)

Source distribution for wgc-mocks 4.0.3
File Size Uploaded
wgc_mocks-4.0.3.tar.gz 1.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for wgc-mocks 4.0.3
File Interpreter ABI Platform
wgc_mocks-4.0.3-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

4.0.3 This release

2 release files

4.0.2

2 release files

4.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page