# evennia.contrib.game_systems.crafting.tests

Unit tests for the crafting system contrib.

class `evennia.contrib.game_systems.crafting.tests.``TestCraftUtils`(methodName='runTest')

  Bases: `evennia.utils.test_resources.BaseEvenniaTestCase`

  Test helper utils for crafting.

  `maxDiff` = None
  `test_load_recipes`()

    This should only load the example module now

class `evennia.contrib.game_systems.crafting.tests.``TestCraftingRecipeBase`(methodName='runTest')

  Bases: `evennia.utils.test_resources.BaseEvenniaTestCase`

  Test the parent recipe class.

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_msg`()

    Test messaging to crafter

  `test_pre_craft`()

    Test validating hook

  `test_pre_craft_fail`()

    Should rase error if validation fails

  `test_craft_hook__succeed`()

    Test craft hook, the main access method.

  `test_craft_hook__fail`()

    Test failing the call

class `evennia.contrib.game_systems.crafting.tests.``TestCraftingRecipe`(methodName='runTest')

  Bases: `evennia.utils.test_resources.BaseEvenniaTestCase`

  Test the CraftingRecipe class with one recipe

  `maxDiff` = None
  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `tearDown`()

    Hook method for deconstructing the test fixture after testing it.

  `test_error_format`()

    Test the automatic error formatter

  `test_craft__success`()

    Test to create a result from the recipe

  `test_seed__success`()

    Test seed helper classmethod

  `test_craft_missing_tool__fail`()

    Fail craft by missing tool2

  `test_craft_missing_cons__fail`()

    Fail craft by missing cons3

  `test_craft_missing_cons__always_consume__fail`()

    Fail craft by missing cons3, with always-consume flag

  `test_craft_wrong_tool__fail`()

    Fail craft by including a wrong tool

  `test_craft_tool_excess__fail`()

    Fail by too many consumables

  `test_craft_cons_excess__fail`()

    Fail by too many consumables

  `test_craft_tool_excess__sucess`()

    Allow too many consumables

  `test_craft_cons_excess__sucess`()

    Allow too many consumables

  `test_craft_tool_order__fail`()

    Strict tool-order recipe fail

  `test_craft_cons_order__fail`()

    Strict tool-order recipe fail

class `evennia.contrib.game_systems.crafting.tests.``TestCraftSword`(methodName='runTest')

  Bases: `evennia.utils.test_resources.BaseEvenniaTestCase`

  Test the craft function by crafting the example sword.

  `setUp`()

    Hook method for setting up the test fixture before exercising it.

  `test_craft_sword`(mockrandom)

    Craft example sword. For the test, every crafting works.

class `evennia.contrib.game_systems.crafting.tests.``TestCraftCommand`(methodName='runTest')

  Bases: `evennia.utils.test_resources.BaseEvenniaCommandTest`

  Test the crafting command

  `setUp`()

    Sets up testing environment

  `test_craft__success`()

    Successfully craft using command

  `test_craft__notools__failure`()

    Craft fail no tools

  `test_craft__nocons__failure`()