| 1 |
""" |
| 2 |
Tests that missing mandatory/recommended properties are reported during publish |
| 3 |
""" |
| 4 |
|
| 5 |
from drivers.alr import run_alr |
| 6 |
from drivers.asserts import assert_match |
| 7 |
from drivers.helpers import init_git_repo |
| 8 |
|
| 9 |
# We have two tarballs ready in the test local index. One is missing maintainer |
| 10 |
# and the other is missing optional tags. |
| 11 |
|
| 12 |
# Attempt with crate missing maintainer |
| 13 |
p = run_alr("publish", "my_index/crates/nomaint.tgz", |
| 14 |
complain_on_error=False, force=True) |
| 15 |
assert_match(".*Missing required properties: maintainers.*", p.out) |
| 16 |
|
| 17 |
# Attempt with crate missing optional recommended properties. No quiet or the |
| 18 |
# warning on optional properties is silenced. |
| 19 |
p = run_alr("publish", "my_index/crates/notags.tgz", |
| 20 |
quiet=False, complain_on_error=False, force=True) |
| 21 |
assert_match(".*Missing optional recommended properties:" |
| 22 |
" authors, licenses, tags, website.*", |
| 23 |
p.out) |
| 24 |
|
| 25 |
print('SUCCESS') |