Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 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']))
Exemplo n.º 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')
Exemplo n.º 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)
Exemplo n.º 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))
Exemplo n.º 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]))
Exemplo n.º 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']))
Exemplo n.º 9
0
 def visualize(self):
     return language.DescriptionConcept(
         u"Blackness", u"You cannot see anything because it is very dark.")