Debian Codegraph @

testsuite/tests/misc/bad-tomlfile/test.py

raw
1 """
2 Check that a bad crate file is warned about
3 """
4
5 from drivers.alr import run_alr
6 from drivers.asserts import assert_match
7
8 import os
9 import re
10
11 # Create a new crate
12 run_alr('init', '--bin', 'xxx')
13
14 # And muck its tomlfile
15 os.chdir('xxx')
16
17 with open("alire.toml", "a") as myfile:
18 myfile.write("SHOULND'T BE HERE")
19
20 # Verify that the expected error is given
21 p = run_alr('show', complain_on_error=False)
22
23 assert_match('.*Cannot continue with invalid session.*'
24 'Failed to load.*',
25 p.out, flags=re.S)
26
27 print('SUCCESS')