Debian Codegraph @

testsuite/tests/publish/broken-manifest/test.py

raw
1 """
2 Check that a locally broken manifest is reported with its full error
3 """
4
5 from drivers.alr import run_alr, init_local_crate
6 from drivers.asserts import assert_match
7 from drivers.helpers import contents, content_of, init_git_repo, zip_dir
8 from shutil import copyfile, rmtree
9 from zipfile import ZipFile
10
11 import os
12
13
14 # Prepare a repo for publishing and break its manifest
15 init_local_crate()
16 # Break the manifest
17 with open("alire.toml", "wt") as manifest:
18 manifest.write("\n---\n")
19
20 # Attempt to publish; should fail with the expected syntax error
21 p = run_alr("publish", force=True, complain_on_error=False)
22 assert_match(".*invalid syntax at.*alire\.toml.*", p.out)
23
24 print('SUCCESS')