Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
 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())
Esempio n. 5
0
 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)
Esempio n. 6
0
 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())
Esempio n. 7
0
 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())
Esempio n. 8
0
 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())