"""
$URL: svn+ssh://svn.mems-exchange.org/repos/trunk/qpy/test/utest_u8.py $
$Id: utest_u8.py 26966 2005-06-25 16:31:50Z dbinger $
"""
from sancho.utest import UTest
from qpy import u8

class Test (UTest):

    def test_u8(self):
        u = u8()
        assert str(u) == ''
        assert u == u8('')
        assert u == ''
        assert u == u8(u'')
        assert u == u8.from_list(['', u'', None])
        assert u8('<') == '<'
        u = u8('\xc3\xbc')
        assert u == u'\xfc'
	u = u8('ok')
	x = u.join(['a', u8('a')])
	assert isinstance(x, u8)
	assert x == u'aoka'
	assert 2 * u == 'okok'
	assert u * 2 == 'okok'


if __name__ == '__main__':
    Test()
