Commit 16e081c9 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

API Project GET hgrc: adapted test for new output

parent 04a95f315766
Pipeline #17138 passed with stage
in 22 minutes and 7 seconds
......@@ -178,7 +178,7 @@ def test_cli_404(test_project):
def test_hgrc_get_put(test_project):
resp = test_project.owner_api_hgrc_get()
assert resp.status_code == 200
assert resp.json() == dict(inherit=True, content=None)
assert resp.json() == dict(inherit=True)
resp = test_project.owner_api_hg_heptapod_config()
assert resp.status_code == 200
......@@ -190,14 +190,7 @@ def test_hgrc_get_put(test_project):
resp = test_project.owner_api_hgrc_get()
assert resp.status_code == 200
as_dict = resp.json()
assert as_dict.get('inherit') is True
content = as_dict['content']
iter_lines = (l.strip() for l in content.splitlines())
while next(iter_lines) != "[heptapod]":
pass
assert [l for l in iter_lines if l] == ['auto-publish = nothing']
assert resp.json() == dict(inherit=True, auto_publish='nothing')
resp = test_project.owner_api_hg_heptapod_config()
assert resp.status_code == 200
......@@ -236,9 +229,9 @@ def test_hgrc_get_put(test_project):
assert resp.status_code == 200
as_json = resp.json()
assert as_json['inherit'] is True
content = as_json['content']
assert "last update by user root (id=1)" in content
assert all(l.startswith('#') for l in content.splitlines())
# TODO after heptapod#301, last update info are not provided
# any more. Would be nice to get it back.
@needs.services
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment