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.2.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.2-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wgc_mocks-4.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 cf509c653f05e507179d2d9c2e59a8dc9fb99e25b1e337becfa1aea0a75b1f98
MD5 3ade31a28d1b8b6567f76efb28873c88
BLAKE2b-256 3aecd7f1b6b6897c671e66892d129dafa88835fd1352c78b7bacabc0c06d44cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wgc_mocks-4.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eebab04b472c530a81cc0ad86d533a8e460324211201ac5760a64c1157db5b8d
MD5 da73dfde3f50a4588bb7aa7e014f9f53
BLAKE2b-256 73fcae4069433cf05bdb09820ceaf6a7c52a92d297e5c2fb7df2439cafbcc589

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