/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-05-06 03:06:18 UTC
  • mfrom: (7500.1.2 trunk-merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200506030618-131sjbc876q7on66
Merge the 3.1 branch.

Merged from https://code.launchpad.net/~jelmer/brz/trunk-merge-3.1/+merge/383481

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for _rio_*."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
from .. import (
22
20
    rio,
23
21
    tests,
24
22
    )
25
 
from ..sixish import (
26
 
    text_type,
27
 
    )
28
23
 
29
24
 
30
25
def load_tests(loader, standard_tests, pattern):
56
51
        self.assertFalse(self.module._valid_tag(""))
57
52
 
58
53
    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")
 
54
        # When str is a unicode type, it is valid for a tag
 
55
        self.assertTrue(self.module._valid_tag(u"foo"))
64
56
 
65
57
    def test_non_ascii_char(self):
66
58
        self.assertFalse(self.module._valid_tag("\xb5"))
76
68
        if s is not None:
77
69
            for tag, value in s.iter_pairs():
78
70
                self.assertIsInstance(tag, str)
79
 
                self.assertIsInstance(value, text_type)
 
71
                self.assertIsInstance(value, str)
80
72
 
81
73
    def assertReadStanzaRaises(self, exception, line_iter):
82
74
        self.assertRaises(exception, self.module._read_stanza_utf8, line_iter)
132
124
        if s is not None:
133
125
            for tag, value in s.iter_pairs():
134
126
                self.assertIsInstance(tag, str)
135
 
                self.assertIsInstance(value, text_type)
 
127
                self.assertIsInstance(value, str)
136
128
 
137
129
    def assertReadStanzaRaises(self, exception, line_iter):
138
130
        self.assertRaises(exception, self.module._read_stanza_unicode,