Skip to content

Fireplace Test Suite

Benedict Etzel edited this page Nov 20, 2015 · 1 revision

The Fireplace test suite is a set of files in the test/ directory used for continuos integration.

It currently consists of the following files:

  • test_dsl.py: tests for DSL selectors and picks
  • test_exceptions.py: tests for which the simulator should exceptions
  • test_hero_powers.py: tests for all hero powers
  • test_interactions.py: special interactions
  • test_main.py: functional tests for cards (will be split eventually)
  • test_mechanics.py: tests for basic game mechanics (such as Stealth, Mana, Windfury...)

Additionally, utils.py provides a set of common functions and a BaseTestGame without mana restrictions, useful for testing:

  • prepare_game: Sets up a game for immediate testing, by randomly drafting the decks and skipping the Mulligan phase. You can pass the hero classes for both players.
  • prepare_empty_game: Like prepare_game, but with empty decks for both players and no fatigue damage. Useful for testing Jousts or cards that activate on draw (e.g. Flame Leviathan).

The test suite can be easily run with py.test. You can run python setup.py develop so that Python can always import the latest fireplace files. You can filter tests by running py.test -k <test name> in order to only execute functions that contain the specificied string.