Skip to main content

Mock server for WGC QA framework: WGNI, WGCPS, CHUB API, Steam mocks on aiohttp

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wgc_mocks-4.0.3.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wgc_mocks-4.0.3-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file wgc_mocks-4.0.3.tar.gz.

File metadata

  • Download URL: wgc_mocks-4.0.3.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for wgc_mocks-4.0.3.tar.gz
Algorithm Hash digest
SHA256 0f3f2230eb0bd8c0d15206069d4cef2941c1a3a7d81eae8058fcc8203cb49899
MD5 30286f965d1766972a4d63b654a27e1b
BLAKE2b-256 8b49a7071843bc616eb628198347229a7eaa4753b04ce789681d22c8669442f7

See more details on using hashes here.

File details

Details for the file wgc_mocks-4.0.3-py3-none-any.whl.

File metadata

  • Download URL: wgc_mocks-4.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for wgc_mocks-4.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 63ce51e7e8705bcd769b55e651d07d249a124c79e92002ce0cadc047ebdea2f6
MD5 b8c5a6a427bc1b8d735af154333ef06e
BLAKE2b-256 0dea2584d360be484e9543cf95ec2a2b2adb6d355661df9def3e1f3a65d069cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page