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)[source]

Bases: evennia.objects.objects.DefaultObject

stat1

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

buffs[source]
at_init()[source]

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

Bases: evennia.objects.objects.DefaultObject.DoesNotExist

exception MultipleObjectsReturned

Bases: evennia.objects.objects.DefaultObject.MultipleObjectsReturned

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

Bases: evennia.utils.test_resources.EvenniaTest

This tests a number of things about buffs.

setUp()[source]

Sets up testing environment

tearDown()[source]

done after every test_* method below

test_addremove()[source]

tests adding and removing buffs

test_getters()[source]

tests all built-in getters

test_details()[source]

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

test_modify()[source]

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

test_trigger()[source]

tests to ensure triggers correctly fire

test_context_conditional()[source]

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

test_complex()[source]

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

test_timing(mock_delay: unittest.mock.Mock)[source]

tests timing-related features, such as ticking and duration

tests the link between the instance attribute and the cache attribute

test_buffableproperty()[source]

tests buffable properties

test_stresstest()[source]

tests large amounts of buffs, and related removal methods

test_modgen()[source]

test generating mods on the fly