def testDescription(self): self.assertEquals( self.format( language.DescriptionConcept(self.thing.name, self.thing.description)), u'[ fake thing ]\n' u'Fake Thing Description\n')
def testEmptyDescription(self): self.thing.description = u'' self.assertEquals( self.format( language.DescriptionConcept(self.thing.name, self.thing.description)), u'[ fake thing ]\n')
def testDescription(self): self._assertECMA48Equality( self.format( language.DescriptionConcept(self.thing.name, self.thing.description)), self.flatten([[ T.bold, T.fg.green, u'[ ', [T.fg.normal, "fake thing"], u' ]\n' ], T.fg.green, u'Fake Thing Description\n']))
def testExitsDescription(self): exits = [StubExit(name=u"north"), StubExit(name=u"west")] self.assertEquals( self.format( language.DescriptionConcept(self.thing.name, self.thing.description, exits)), u'[ fake thing ]\n' u'( north west )\n' u'Fake Thing Description\n')
def testDescriptionContributors(self): a = FakeDescriptionContributor(u"first part") b = FakeDescriptionContributor(u"last part") self.assertEquals( self.format( language.DescriptionConcept(self.thing.name, self.thing.description, others=[a, b])), u'[ fake thing ]\n' u'Fake Thing Description\n' + a.descr + u"\n" + b.descr)
def visualize(self): container = iimaginary.IContainer(self.thing, None) if container is not None: exits = list(container.getExits()) else: exits = () return language.DescriptionConcept( self.name, self.description, exits, self.powerupsFor(iimaginary.IDescriptionContributor))
def testDescriptionContributors(self): a = FakeDescriptionContributor(u"first part") b = FakeDescriptionContributor(u"last part") self._assertECMA48Equality( self.format( language.DescriptionConcept(self.thing.name, self.thing.description, others=[a, b])), self.flatten([[[ T.bold, T.fg.green, u'[ ', [T.fg.normal, "fake thing"], u' ]\n' ], T.fg.green, u'Fake Thing Description\n'], a.descr + u"\n" + b.descr]))
def testExitsDescription(self): exits = [StubExit(name=u"north"), StubExit(name=u"west")] self._assertECMA48Equality( self.format( language.DescriptionConcept(self.thing.name, self.thing.description, exits)), self.flatten([[ T.bold, T.fg.green, u'[ ', [T.fg.normal, "fake thing"], u' ]\n' ], [ T.bold, T.fg.green, u'( ', [T.fg.normal, T.fg.yellow, u'north west'], u' )', u'\n' ], T.fg.green, u'Fake Thing Description\n']))
def visualize(self): return language.DescriptionConcept( u"Blackness", u"You cannot see anything because it is very dark.")