def test_strxfrm(self): # TODO more tests would be nice import _locale _locale.setlocale(_locale.LC_ALL, "C") a = "1234" b = _locale.strxfrm(a) assert a is not b assert a == b raises(TypeError, _locale.strxfrm, 1) _locale.setlocale(_locale.LC_ALL, self.language_pl) a = "1234" b = _locale.strxfrm(a) assert a is not b
def test_strxfrm(): str1 = "this is a test !" str2 = _locale.strxfrm(str1) cmp(str1, str2) str1 = "this is a test&^%%^$%$ !" str2 = _locale.strxfrm(str1) cmp(str1, str2) str1 = "this \" \"is a test&^%%^$%$ !" str2 = _locale.strxfrm(str1) cmp(str1, str2) str1 = "123456789" str2 = _locale.strxfrm(str1) cmp(str1, str2) #argument is int type i = 12 AssertError(TypeError, _locale.strxfrm, i) #argument is random type obj = _random.Random() AssertError(TypeError, _locale.strxfrm, obj)
def test_strxfrm(self): str1 = "this is a test !" str2 = _locale.strxfrm(str1) str1.__eq__(str2) str1 = "this is a test&^%%^$%$ !" str2 = _locale.strxfrm(str1) str1.__eq__(str2) str1 = "this \" \"is a test&^%%^$%$ !" str2 = _locale.strxfrm(str1) str1.__eq__(str2) str1 = "123456789" str2 = _locale.strxfrm(str1) str1.__eq__(str2) #argument is int type i = 12 self.assertRaises(TypeError, _locale.strxfrm, i) #argument is random type obj = random.Random() self.assertRaises(TypeError, _locale.strxfrm, obj)
def test_strxfrm(self): str1 = "this is a test !" str2 = _locale.strxfrm(str1) cmp(str1,str2) str1 = "this is a test&^%%^$%$ !" str2 = _locale.strxfrm(str1) cmp(str1,str2) str1 = "this \" \"is a test&^%%^$%$ !" str2 = _locale.strxfrm(str1) cmp(str1,str2) str1 = "123456789" str2 = _locale.strxfrm(str1) cmp(str1,str2) #argument is int type i = 12 self.assertRaises(TypeError,_locale.strxfrm,i) #argument is random type obj = random.Random() self.assertRaises(TypeError,_locale.strxfrm,obj)
def test_strxfrm(): str1 = "this is a test !" str2 = _locale.strxfrm(str1) cmp(str1, str2) str1 = "this is a test&^%%^$%$ !" str2 = _locale.strxfrm(str1) cmp(str1, str2) str1 = 'this " "is a test&^%%^$%$ !' str2 = _locale.strxfrm(str1) cmp(str1, str2) str1 = "123456789" str2 = _locale.strxfrm(str1) cmp(str1, str2) # argument is int type i = 12 AssertError(TypeError, _locale.strxfrm, i) # argument is random type obj = _random.Random() AssertError(TypeError, _locale.strxfrm, obj)
def test_strxfrm(self): # TODO more tests would be nice import _locale _locale.setlocale(_locale.LC_ALL, "C") a = "1234" b = _locale.strxfrm(a) assert a is not b assert a == b with raises(TypeError): _locale.strxfrm(1) with raises(ValueError): _locale.strxfrm("a\x00b") _locale.setlocale(_locale.LC_ALL, self.language_pl) a = "1234" b = _locale.strxfrm(a) assert a is not b