示例#1
0
    def test_get_short_printable_repr_unicode_value_unicode(self):
        dc = KeyValueContainer([(u'aéb', [u'céd']), (u'b', ['2', '3'])])
        dc.MAX_PRINTABLE = 7
        token = DataToken(u'aéb', u'céd', (u'aéb', 0))
        dc.set_token(token)

        self.assertEqual(dc.get_short_printable_repr(), '...a.b=c.d...')
示例#2
0
    def test_get_short_printable_repr_unicode_value(self):
        dc = KeyValueContainer([(u'a', ['x']), (u'b', ['2', '3'])])
        dc.MAX_PRINTABLE = 5
        token = DataToken('a', 'é', ('a', 0))
        dc.set_token(token)

        self.assertEqual(dc.get_short_printable_repr(), '...a=....')
示例#3
0
    def test_get_short_printable_repr_unicode_value_unicode(self):
        dc = KeyValueContainer([(u'aéb', [u'céd']), (u'b', ['2', '3'])])
        dc.MAX_PRINTABLE = 7
        token = DataToken(u'aéb', u'céd', (u'aéb', 0))
        dc.set_token(token)

        self.assertEqual(dc.get_short_printable_repr(), '...a.b=c.d...')
示例#4
0
    def test_get_short_printable_repr_unicode_value(self):
        dc = KeyValueContainer([(u'a', ['x']), (u'b', ['2', '3'])])
        dc.MAX_PRINTABLE = 5
        token = DataToken('a', 'é', ('a', 0))
        dc.set_token(token)

        self.assertEqual(dc.get_short_printable_repr(), '...a=....')
示例#5
0
    def test_get_short_printable_repr_token_obj_reduce_printable(self):
        dc = KeyValueContainer([(u'a', ['1']), (u'b', ['2', '3'])])
        dc.MAX_PRINTABLE = 5
        token = DataToken('a', '1', ('a', 0))
        dc.set_token(token)

        self.assertIsNotNone(dc.get_token())
        self.assertEqual(dc.get_short_printable_repr(), '...a=1...')
示例#6
0
    def test_get_short_printable_repr_token_obj_reduce_printable(self):
        dc = KeyValueContainer([(u'a', ['1']), (u'b', ['2', '3'])])
        dc.MAX_PRINTABLE = 5
        token = DataToken('a', '1', ('a', 0))
        dc.set_token(token)

        self.assertIsNotNone(dc.get_token())
        self.assertEqual(dc.get_short_printable_repr(), '...a=1...')