Skip to content

Commit

Permalink
Merge pull request pypa#2774 from aerusso/mrs/edit_config-case-sensitive
Browse files Browse the repository at this point in the history
Preserve case of keys in edit_config
  • Loading branch information
jaraco authored Sep 9, 2021
2 parents 4fa006d + 3ce32eb commit fdb818d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions setuptools/tests/test_setopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ def test_utf8_encoding_retained(self, tmpdir):

def test_case_retained(self, tmpdir):
"""
When editing a file, case of keys should be retained.
"""
config = tmpdir.join('setup.cfg')
self.write_text(str(config), '[names]\nJARACO=jaraco')
setopt.edit_config(str(config), dict())
assert 'JARACO' in config.read_text(encoding='ascii')
self.write_text(str(config), '[names]\nFoO=bAr')
setopt.edit_config(str(config), dict(names=dict(oTher='yes')))
actual = config.read_text(encoding='ascii')
assert 'FoO' in actual
assert 'oTher' in actual

0 comments on commit fdb818d

Please sign in to comment.