Improve toml parsing

This commit is contained in:
frostming
2018-11-08 10:22:26 +08:00
parent a167885904
commit 3eba19d359
3 changed files with 40 additions and 54 deletions
+18
View File
@@ -143,3 +143,21 @@ six = {{version = "*", index = "pypi"}}
f.write(contents)
c = p.pipenv('install')
assert c.return_code == 0
@pytest.mark.install
@pytest.mark.project
def test_rewrite_outline_table(PipenvInstance, pypi):
with PipenvInstance(pypi=pypi, chdir=True) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
[packages.requests]
version = "*"
""".strip()
f.write(contents)
c = p.pipenv('install click')
assert c.return_code == 0
with open(p.pipfile_path) as f:
contents = f.read()
assert "[packages.requests]" not in contents
assert 'requests = { version = "*" }' in contents