Exemple #1
0
 def testDescription(self):
     self.assertEquals(
         self.format(
             language.DescriptionConcept(self.thing.name,
                                         self.thing.description)),
         u'[ fake thing ]\n'
         u'Fake Thing Description\n')
Exemple #2
0
 def testEmptyDescription(self):
     self.thing.description = u''
     self.assertEquals(
         self.format(
             language.DescriptionConcept(self.thing.name,
                                         self.thing.description)),
         u'[ fake thing ]\n')
Exemple #3
0
 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']))
Exemple #4
0
 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')
Exemple #5
0
 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)
Exemple #6
0
    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))
Exemple #7
0
 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]))
Exemple #8
0
 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']))
Exemple #9
0
 def visualize(self):
     return language.DescriptionConcept(
         u"Blackness", u"You cannot see anything because it is very dark.")