Exemplo n.º 1
0
 def test_long_unicode(self):
     one_line_u = self._long_u.replace("\n", " ")
     mismatch = _BinaryMismatch(one_line_u, "!~", self._long_u)
     self.assertEqual(mismatch.describe(),
         "%s:\nreference = %s\nactual    = %s\n" % ("!~",
             text_repr(one_line_u),
             text_repr(self._long_u, multiline=True)))
Exemplo n.º 2
0
 def test_long_unicode_and_object(self):
     obj = object()
     mismatch = _BinaryMismatch(self._long_u, "!~", obj)
     self.assertEqual(mismatch.describe(),
         "%s:\nreference = %s\nactual    = %s\n" % ("!~",
             text_repr(self._long_u, multiline=True),
             repr(obj)))
Exemplo n.º 3
0
 def test_long_unicode(self):
     one_line_u = self._long_u.replace("\n", " ")
     mismatch = _BinaryMismatch(one_line_u, "!~", self._long_u)
     self.assertEqual(
         mismatch.describe(), "%s:\nreference = %s\nactual    = %s\n" %
         ("!~", text_repr(one_line_u),
          text_repr(self._long_u, multiline=True)))
Exemplo n.º 4
0
 def test_long_bytes(self):
     one_line_b = self._long_b.replace(_b("\n"), _b(" "))
     mismatch = _BinaryMismatch(one_line_b, "!~", self._long_b)
     self.assertEqual(mismatch.describe(),
         "%s:\nreference = %s\nactual    = %s\n" % ("!~",
             text_repr(one_line_b),
             text_repr(self._long_b, multiline=True)))
Exemplo n.º 5
0
 def test_long_bytes(self):
     one_line_b = self._long_b.replace(_b("\n"), _b(" "))
     mismatch = _BinaryMismatch(one_line_b, "!~", self._long_b)
     self.assertEqual(
         mismatch.describe(), "%s:\nreference = %s\nactual    = %s\n" %
         ("!~", text_repr(one_line_b),
          text_repr(self._long_b, multiline=True)))
Exemplo n.º 6
0
 def test_long_mixed_strings(self):
     mismatch = _BinaryMismatch(self._long_b, "!~", self._long_u)
     self.assertEqual(
         mismatch.describe(), "%s:\nreference = %s\nactual    = %s\n" % (
             "!~",
             text_repr(self._long_u, multiline=True),
             text_repr(self._long_b, multiline=True),
         ))
Exemplo n.º 7
0
 def test_long_unicode_and_object(self):
     obj = object()
     mismatch = _BinaryMismatch(self._long_u, "!~", obj)
     self.assertEqual(
         mismatch.describe(), "%s:\nreference = %s\nactual    = %s\n" % (
             "!~",
             repr(obj),
             text_repr(self._long_u, multiline=True),
         ))
Exemplo n.º 8
0
 def test_long_bytes_and_object(self):
     obj = object()
     mismatch = _BinaryMismatch(self._long_b, "!~", obj)
     self.assertEqual(
         mismatch.describe(),
         "{}:\nreference = {}\nactual    = {}\n".format(
             "!~",
             repr(obj),
             text_repr(self._long_b, multiline=True),
         ))
Exemplo n.º 9
0
 def test_long_mixed_strings(self):
     mismatch = _BinaryMismatch(self._long_b, "!~", self._long_u)
     self.assertEqual(
         mismatch.describe(),
         "%s:\nreference = %s\nactual    = %s\n" % (
             "!~",
             text_repr(self._long_u, multiline=True),
             text_repr(self._long_b, multiline=True),
         )
     )
Exemplo n.º 10
0
 def test_short_mixed_strings(self):
     b, u = _b("\xa7"), "\xa7"
     mismatch = _BinaryMismatch(b, "!~", u)
     self.assertEqual(mismatch.describe(), "{!r} !~ {!r}".format(b, u))
Exemplo n.º 11
0
 def test_short_objects(self):
     o1, o2 = self.CustomRepr('a'), self.CustomRepr('b')
     mismatch = _BinaryMismatch(o1, "!~", o2)
     self.assertEqual(mismatch.describe(), "{!r} !~ {!r}".format(o1, o2))
Exemplo n.º 12
0
 def test_short_mixed_strings(self):
     b, u = _b("\xa7"), _u("\xa7")
     mismatch = _BinaryMismatch(b, "!~", u)
     self.assertEqual(mismatch.describe(), "%r !~ %r" % (b, u))
Exemplo n.º 13
0
 def test_short_objects(self):
     o1, o2 = self.CustomRepr('a'), self.CustomRepr('b')
     mismatch = _BinaryMismatch(o1, "!~", o2)
     self.assertEqual(mismatch.describe(), "%r !~ %r" % (o1, o2))
Exemplo n.º 14
0
 def test_short_mixed_strings(self):
     b, u = _b("\xa7"), _u("\xa7")
     mismatch = _BinaryMismatch(b, "!~", u)
     self.assertEqual(mismatch.describe(), "%r !~ %r" % (b, u))
Exemplo n.º 15
0
 def test_short_objects(self):
     o1, o2 = object(), object()
     mismatch = _BinaryMismatch(o1, "!~", o2)
     self.assertEqual(mismatch.describe(), "%r !~ %r" % (o1, o2))
Exemplo n.º 16
0
 def test_short_objects(self):
     o1, o2 = object(), object()
     mismatch = _BinaryMismatch(o1, "!~", o2)
     self.assertEqual(mismatch.describe(), "%r !~ %r" % (o1, o2))