/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test__rio.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-07 02:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200207021430-m49iq3x4x8xlib6x
Drop python2 support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    rio,
23
23
    tests,
24
24
    )
25
 
from ..sixish import (
26
 
    text_type,
27
 
    )
28
25
 
29
26
 
30
27
def load_tests(loader, standard_tests, pattern):
56
53
        self.assertFalse(self.module._valid_tag(""))
57
54
 
58
55
    def test_unicode(self):
59
 
        if text_type is str:
60
 
            # When str is a unicode type, it is valid for a tag
61
 
            self.assertTrue(self.module._valid_tag(u"foo"))
62
 
        else:
63
 
            self.assertRaises(TypeError, self.module._valid_tag, u"foo")
 
56
        # When str is a unicode type, it is valid for a tag
 
57
        self.assertTrue(self.module._valid_tag(u"foo"))
64
58
 
65
59
    def test_non_ascii_char(self):
66
60
        self.assertFalse(self.module._valid_tag("\xb5"))
76
70
        if s is not None:
77
71
            for tag, value in s.iter_pairs():
78
72
                self.assertIsInstance(tag, str)
79
 
                self.assertIsInstance(value, text_type)
 
73
                self.assertIsInstance(value, str)
80
74
 
81
75
    def assertReadStanzaRaises(self, exception, line_iter):
82
76
        self.assertRaises(exception, self.module._read_stanza_utf8, line_iter)
132
126
        if s is not None:
133
127
            for tag, value in s.iter_pairs():
134
128
                self.assertIsInstance(tag, str)
135
 
                self.assertIsInstance(value, text_type)
 
129
                self.assertIsInstance(value, str)
136
130
 
137
131
    def assertReadStanzaRaises(self, exception, line_iter):
138
132
        self.assertRaises(exception, self.module._read_stanza_unicode,