evennia.contrib.rpg.buffs.tests

Tests for the buff system contrib

class evennia.contrib.rpg.buffs.tests.BuffableObject(id, db_key, db_typeclass_path, db_date_created, db_lock_storage, db_account, db_sessid, db_location, db_home, db_destination, db_cmdset_storage)[源代码]

基类:evennia.objects.objects.DefaultObject

stat1

An example of a way you can extend AttributeProperty to create properties that automatically check buffs for you.

buffs[源代码]
at_init()[源代码]

This is always called whenever this object is initiated – that is, whenever it its typeclass is cached from memory. This happens on-demand first time the object is used or activated in some way after being created but also after each server restart or reload.

exception DoesNotExist

基类:evennia.objects.objects.DefaultObject.DoesNotExist

exception MultipleObjectsReturned

基类:evennia.objects.objects.DefaultObject.MultipleObjectsReturned

path = 'evennia.contrib.rpg.buffs.tests.BuffableObject'
typename = 'BuffableObject'
class evennia.contrib.rpg.buffs.tests.TestBuffsAndHandler(methodName='runTest')[源代码]

基类:evennia.utils.test_resources.EvenniaTest

This tests a number of things about buffs.

setUp()[源代码]

Sets up testing environment

tearDown()[源代码]

done after every test_* method below

test_addremove()[源代码]

tests adding and removing buffs

test_getters()[源代码]

tests all built-in getters

test_details()[源代码]

tests that buff details like name and flavor are correct; also test modifier viewing

test_modify()[源代码]

tests to ensure that values are modified correctly, and stack across mods

test_trigger()[源代码]

tests to ensure triggers correctly fire

test_context_conditional()[源代码]

tests to ensure context is passed to buffs, and also tests conditionals

test_complex()[源代码]

tests a complex mod (conditionals, multiple triggers/mods)

test_timing(mock_delay: unittest.mock.Mock)[源代码]

tests timing-related features, such as ticking and duration

tests the link between the instance attribute and the cache attribute

test_buffableproperty()[源代码]

tests buffable properties

test_stresstest()[源代码]

tests large amounts of buffs, and related removal methods

test_modgen()[源代码]

test generating mods on the fly