~divmod-dev/divmod.org/empty-host-header-2936

« back to all changes in this revision

Viewing changes to Imaginary/imaginary/test/test_container.py

  • Committer: glyph
  • Date: 2009-06-29 04:03:17 UTC
  • Revision ID: svn-v4:866e43f7-fbfc-0310-8f2a-ec88d1da2979:trunk:17590
Remove all usage of `installOn()` from Imaginary.

This change replaces the undocumented `ThingMixin`, and the unfortunately-named, poorly-considered idiom of using `installOn` with its subclasses, with a new, thoroughly documented and better-named mixin, `imaginary.enhancement.Enhancement`.

Furthermore, this updates `createCreator` to use `Enhancement`s rather than arbitrary powerups.

The tests and included systems now also provide a good example of how Imaginary application / game code should idiomatically fit into the framework.

Author: glyph

Reviewer: exarkun

Fixes #2558

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
from twisted.trial import unittest
4
4
 
5
5
from axiom import store
6
 
from axiom.dependency import installOn
7
6
 
8
7
from imaginary import eimaginary, objects
9
8
 
11
10
    def setUp(self):
12
11
        self.store = store.Store()
13
12
        self.containmentCore = objects.Thing(store=self.store, name=u"container")
14
 
        self.container = objects.Container(store=self.store, capacity=1)
15
 
        installOn(self.container, self.containmentCore)
 
13
        self.container = objects.Container.createFor(self.containmentCore, capacity=1)
16
14
        self.object = objects.Thing(store=self.store, name=u"object")
17
15
 
18
16