diff options
| author | Antonio Russo <aerusso@aerusso.net> | 2021-09-06 19:03:28 -0600 |
|---|---|---|
| committer | Antonio Russo <aerusso@aerusso.net> | 2021-09-06 20:54:37 -0600 |
| commit | de5b49b73864d3de963ab24e928c189284ba35f1 (patch) | |
| tree | 4e0398307f407e667c573d320d2931f09d8a931f /setuptools/tests | |
| parent | b254ea77cd8328ab6e9fbe84db6718bcf6b014d4 (diff) | |
| download | python-setuptools-git-de5b49b73864d3de963ab24e928c189284ba35f1.tar.gz | |
Preserve case of keys during edit_config
This aligns behavior with 21b122e06969a9d85c65ce8276519d34da7dc747
during source distribution generation.
Signed-off-by: Antonio Russo <aerusso@aerusso.net>
Diffstat (limited to 'setuptools/tests')
| -rw-r--r-- | setuptools/tests/test_setopt.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/setuptools/tests/test_setopt.py b/setuptools/tests/test_setopt.py index 0163f9af..a34d3f61 100644 --- a/setuptools/tests/test_setopt.py +++ b/setuptools/tests/test_setopt.py @@ -28,3 +28,14 @@ class TestEdit: parser = self.parse_config(str(config)) assert parser.get('names', 'jaraco') == 'джарако' assert parser.get('names', 'other') == 'yes' + + 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]\nFoO=bAr') + setopt.edit_config(str(config), dict(names=dict(oTher='yes'))) + parser = self.parse_config(str(config)) + assert parser.get('names', 'FoO') == 'bAr' + assert parser.get('names', 'oTher') == 'yes' |
