summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_userstring.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_userstring.py')
-rw-r--r--Lib/test/test_userstring.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_userstring.py b/Lib/test/test_userstring.py
index 7152822..19b0acf 100644
--- a/Lib/test/test_userstring.py
+++ b/Lib/test/test_userstring.py
@@ -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()