def test_fallbackIdentifierStable(self): """ If L{MethodSuffixOutputer} generates an identifier for the wrapped object then it generates the same identifier for all calls to C{identifier} regardless of changes to the wrapped object. """ world = ["first state"] outputer = MethodSuffixOutputer(world) firstIdentifier = outputer.identifier() world.append("second state") secondIdentifier = outputer.identifier() self.assertEqual(firstIdentifier, secondIdentifier)
def test_fallbackIdentifierStable(self): """ If L{MethodSuffixOutputer} generates an identifier for the wrapped object then it generates the same identifier for all calls to C{identifier} regardless of changes to the wrapped object. """ world = ["first state"] outputer = MethodSuffixOutputer(world) firstIdentifier = outputer.identifier() world.append("second state") secondIdentifier = outputer.identifier() self.assertEqual(firstIdentifier, secondIdentifier)
def test_unicodeFallbackIdentifier(self): """ If the wrapped object has no C{identifier} method then the identifier generated by L{MethodSuffixOutputer.identifier} is a L{unicode} string. """ world = object() outputer = MethodSuffixOutputer(world) self.assertIsInstance(outputer.identifier(), unicode)
def test_wrappedIdentifier(self): """ If the wrapped object has an C{identifier} method then its return value is returned by L{MethodSuffixOutputer.identifier}. """ world = AnimalWorld([]) outputer = MethodSuffixOutputer(world) self.assertEqual(world.identifier(), outputer.identifier())
def test_unicodeFallbackIdentifier(self): """ If the wrapped object has no C{identifier} method then the identifier generated by L{MethodSuffixOutputer.identifier} is a L{unicode} string. """ world = object() outputer = MethodSuffixOutputer(world) self.assertIsInstance(outputer.identifier(), unicode)
def test_wrappedIdentifier(self): """ If the wrapped object has an C{identifier} method then its return value is returned by L{MethodSuffixOutputer.identifier}. """ world = AnimalWorld([]) outputer = MethodSuffixOutputer(world) self.assertEqual(world.identifier(), outputer.identifier())
def test_fallbackIdentifier(self): """ If the wrapped object has no C{identifier} method then L{MethodSuffixOutputer.identifier} generates an identifier for the wrapped object and returns that. """ world = object() outputer = MethodSuffixOutputer(world) self.assertEqual(repr(world), outputer.identifier())
def test_fallbackIdentifier(self): """ If the wrapped object has no C{identifier} method then L{MethodSuffixOutputer.identifier} generates an identifier for the wrapped object and returns that. """ world = object() outputer = MethodSuffixOutputer(world) self.assertEqual(repr(world), outputer.identifier())