示例#1
0
 def test_repr_shortens_long_values(self):
     fake = Fake("widget").provides("set_bits").with_args(
         "12345678910111213141516171819202122232425262728293031"
     )
     try:
         fake.set_bits()
     except AssertionError, exc:
         eq_(str(exc),
         "fake:widget.set_bits('123456789101112131415161718192021222324252627...') "
         "was called unexpectedly with args ()")
示例#2
0
 def test_repr_shortens_long_values(self):
     fake = Fake("widget").provides("set_bits").with_args(
         "12345678910111213141516171819202122232425262728293031")
     try:
         fake.set_bits()
     except AssertionError, exc:
         eq_(
             str(exc),
             "fake:widget.set_bits('123456789101112131415161718192021222324252627...') "
             "was called unexpectedly with args ()")
示例#3
0
 def test_kwarg_diffs_are_not_shortened(self):
     fake = Fake("widget").provides("set_bits").with_args(
         newbits="12345678910111213141516171819202122232425262728293031"
     )
     try:
         # this should not be shortened but the above arg spec should:
         fake.set_bits(newbits="99999999999999999999999999999999999999999999999999999999")
     except AssertionError, exc:
         eq_(str(exc),
         "fake:widget.set_bits(newbits='123456789101112131415161718192021222324252627...') "
         "was called unexpectedly with args "
         "(newbits='99999999999999999999999999999999999999999999999999999999')")
示例#4
0
 def test_arg_diffs_are_not_shortened(self):
     fake = Fake("widget").provides("set_bits").with_args(
         "12345678910111213141516171819202122232425262728293031")
     try:
         # this should not be shortened but the above arg spec should:
         fake.set_bits(
             "99999999999999999999999999999999999999999999999999999999")
     except AssertionError, exc:
         eq_(
             str(exc),
             "fake:widget.set_bits('123456789101112131415161718192021222324252627...') "
             "was called unexpectedly with args "
             "('99999999999999999999999999999999999999999999999999999999')")