1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-07 21:58:41 +02:00

Disable configparser interpolation to allow unescaped '%' in values

This commit is contained in:
2022-10-04 09:36:10 +02:00
parent a68f96fc7f
commit 5094099f08
2 changed files with 27 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
import unittest
from osc.OscConfigParser import OscConfigParser
class TestOscConfigParser(unittest.TestCase):
def setUp(self):
self.parser = OscConfigParser()
self.parser.read_string("""
[general]
apiurl = http://localhost
[http://localhost]
credentials_mgr_class=
user=
pass=
""")
def test_disabled_interpolation(self):
# with interpolation on, this would raise
# ValueError: invalid interpolation syntax in '%' at position 0
self.parser.set("http://localhost", "pass", "%")
if __name__ == "__main__":
unittest.main()