Example #1
0
 def test_repr_just_id(self):
     # repr(placeholder) shows you how the object was constructed.
     error = self.makeException()
     test = ErrorHolder("test id", error)
     self.assertEqual(
         "<testtools.testcase.ErrorHolder(%r, %r)>" % (test.id(), error),
         repr(test))
 def test_repr_just_id(self):
     # repr(placeholder) shows you how the object was constructed.
     error = self.makeException()
     test = ErrorHolder("test id", error)
     self.assertEqual(
         "<testtools.testcase.ErrorHolder(%r, %r)>" % (test.id(), error),
         repr(test))
Example #3
0
 def makePlaceHolder(self,
                     test_id="foo",
                     error=None,
                     short_description=None):
     if error is None:
         error = self.makeException()
     return ErrorHolder(test_id, error, short_description)
 def test_shortDescription_specified(self):
     # If a shortDescription is provided to the constructor, then
     # shortDescription() returns that instead.
     test = ErrorHolder("test id", self.makeException(), "description")
     self.assertEqual("description", test.shortDescription())
 def test_shortDescription_is_id(self):
     # The shortDescription() of a PlaceHolder is the id, by default.
     test = ErrorHolder("test id", self.makeException())
     self.assertEqual(test.id(), test.shortDescription())
 def test_id_comes_from_constructor(self):
     # The id() of a PlaceHolder is whatever you pass into the constructor.
     test = ErrorHolder("test id", self.makeException())
     self.assertEqual("test id", test.id())
Example #7
0
 def test_shortDescription_specified(self):
     # If a shortDescription is provided to the constructor, then
     # shortDescription() returns that instead.
     test = ErrorHolder("test id", self.makeException(), "description")
     self.assertEqual("description", test.shortDescription())
Example #8
0
 def test_shortDescription_is_id(self):
     # The shortDescription() of a PlaceHolder is the id, by default.
     test = ErrorHolder("test id", self.makeException())
     self.assertEqual(test.id(), test.shortDescription())
Example #9
0
 def test_id_comes_from_constructor(self):
     # The id() of a PlaceHolder is whatever you pass into the constructor.
     test = ErrorHolder("test id", self.makeException())
     self.assertEqual("test id", test.id())