Mercurial > genshi > mirror
diff markup/tests/builder.py @ 98:44af12832c5a trunk
Bugfix in `builder` module: attribute values need to be converted to strings when generating streams.
author | cmlenz |
---|---|
date | Fri, 21 Jul 2006 18:23:23 +0000 |
parents | 0f8800c46e21 |
children |
line wrap: on
line diff
--- a/markup/tests/builder.py +++ b/markup/tests/builder.py @@ -29,6 +29,16 @@ self.assertEqual((Stream.TEXT, u'Bar', (None, -1, -1)), bits.next()) self.assertEqual((Stream.END, 'a', (None, -1, -1)), bits.next()) + def test_nonstring_attributes(self): + """ + Verify that if an attribute value is given as an int (or some other + non-string type), it is coverted to a string when the stream is + generated. + """ + event = iter(tag.foo(id=3)).next() + self.assertEqual((Stream.START, ('foo', [('id', '3')]), (None, -1, -1)), + event) + def suite(): suite = unittest.TestSuite()