Kaydet (Commit) 4657c735 authored tarafından Batuhan Taşkaya's avatar Batuhan Taşkaya

move test to proper file

üst 40cb664b
......@@ -70,17 +70,6 @@ class TestUserObjects(unittest.TestCase):
obj[123] = "abc"
self._copy_test(obj)
def test_str_rmod(self):
class ustr2(UserString):
pass
class ustr3(ustr2):
def __rmod__(self, other):
return super().__rmod__(other)
fmt2 = ustr2('value is %s')
str3 = ustr3('TEST')
self.assertEqual(fmt2 % str3, 'value is TEST')
################################################################################
### ChainMap (helper class for configparser and the string module)
......
......@@ -39,6 +39,18 @@ class UserStringTest(
# we don't fix the arguments, because UserString can't cope with it
getattr(object, methodname)(*args)
def test_rmod(self):
class ustr2(UserString):
pass
class ustr3(ustr2):
def __rmod__(self, other):
return super().__rmod__(other)
fmt2 = ustr2('value is %s')
str3 = ustr3('TEST')
self.assertEqual(fmt2 % str3, 'value is TEST')
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment