TestBox
Test/TAS framework for DOSBox.
Run:
docker-compose -f docker-compose.example.yml run test
Or:
docker-compose -f docker-compose.example.console.yml run test
Tested on Ubuntu 20.10.
Example
As test application I used "demo" version of Soko-Ban by Spectrum HoloByte. Please notice that test application is only included as an example. It is unplayable after level 2.
Test scenario includes full walkthrough of level 1.
import testbox
with testbox.TestBox(['SOKOBAN.EXE'], {'cpu': {'cycles': 'max'}}) as box:
box.wait_image('images/graphics.png', timeout=1)
box.send_keys('C\r') # CGA mode.
box.wait_image('images/input.png', timeout=1)
box.send_keys('K\r') # Input from keyboard.
box.wait_image('images/door.png', timeout=5)
box.send_keys('\r') # Enter door.
box.wait_image('images/lobby.png', timeout=1)
box.send_keys('\r') # Enter elevator.
box.wait_image('images/menu.png', timeout=5)
box.send_keys('TEST\r') # Enter player name.
box.wait_image('images/start.png', timeout=1)
box.send_keys('\r') # Select single player mode.
box.wait_image('images/elevator.png', timeout=1)
box.send_keys('1A') # Select first floor and accept.
for step, keys in (
('one', '▴◂◂◂▴▴▴◂▴◂◂▾◂◂▾▾▾▸▸▸▸▸▸▸▸▸▸▸▸▸▾▸▴◂◂'),
('two', '◂◂◂◂◂◂◂▴▴▴◂▴◂◂▾▾▾▴▴◂◂▾▾▾▸▸▸▸▸▸▸▸▸▸▸▸▴▸▾◂▾▸▴◂'),
('three', '◂◂◂◂◂◂◂▴▴▴◂◂▴◂▾▾▾▴▴◂◂▾▾▾▸▸▸▸▸▸▸▸▸▸▸▸▾▸▴◂'),
('four', '◂◂◂◂◂◂◂▴▴▴◂◂▴▴▴◂▾▾▾▾▾▴▴◂◂▾▾▾▸▸▸▸▸▸▸▸▸▸▸▴▸▾◂▾▸▴'),
('five', '◂◂◂◂◂◂◂▴▴▴◂◂▴▴▴▸▾▾◂◂▾◂◂▾▾◂◂▾▸▸▸▸▸▸▸▸▸▸▸▸▸▸▸◂'),
('six', '◂◂◂◂◂◂◂▴▴▴◂◂▴◂▾▾▾▴▴◂◂▾▾▾▸▸▸▸▸▸▸▸▸▸▸▸'),
):
# Checkpoint, skipping status bar.
box.wait_image(f'images/step-{step}.png', bbox=(0, 0, 320, 191), timeout=3)
for key in keys:
box.send_keys(key)
# Waiting move counter to update.
box.wait_change(bbox=(75, 191, 110, 200), timeout=1)
box.wait_image('images/victory.png', timeout=10) # Level 2.
Metadata
Release files for testbox 1.0.4
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 |
|---|---|---|---|---|
| testbox-1.0.4.tar.gz | 4.9 kB | Without provenance | Details for testbox-1.0.4.tar.gz |
Release files / testbox-1.0.4.tar.gz
| Download URL | testbox-1.0.4.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfc979f0e0c949a0dca23bdf9e4f9a1b79d0677ee98fae16fce93502c6bcdb34
|
|
BLAKE2b-256 checksum How to use checksums |
8cfb57ea979768ee7efa880bda0ca26293eea7e377a1fd0be660182dbe1e1788
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for testbox 1.0.4
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.