# 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)

  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`
  `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`

    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')

  Bases: `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

  `test_cacheattrlink`()

    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