evennia.contrib.game_systems.crafting.tests

Unit tests for the crafting system contrib.

class evennia.contrib.game_systems.crafting.tests.TestCraftUtils(methodName='runTest')[源代码]

基类: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')[源代码]

基类: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')[源代码]

基类: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')[源代码]

基类: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')[源代码]

基类: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()[源代码]
test_craft__unknown_recipe__failure()[源代码]