mirror of
https://github.com/servo/servo.git
synced 2025-07-24 07:40:27 +01:00
report when blocked package exception is not needed
This commit is contained in:
parent
3ced8d4ddc
commit
aa7ba1a850
3 changed files with 60 additions and 1 deletions
26
python/tidy/servo_tidy_tests/blocked_package.lock
Normal file
26
python/tidy/servo_tidy_tests/blocked_package.lock
Normal file
|
@ -0,0 +1,26 @@
|
|||
[root]
|
||||
name = "servo"
|
||||
version = "0.0.1"
|
||||
|
||||
[[package]]
|
||||
name = "test_blocked"
|
||||
version = "0.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "test_exception"
|
||||
version = "0.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "test_unneeded_exception"
|
||||
version = "0.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
]
|
|
@ -229,6 +229,25 @@ class CheckTidiness(unittest.TestCase):
|
|||
|
||||
self.assertNoMoreErrors(errors)
|
||||
|
||||
def test_lock_exceptions(self):
|
||||
tidy.config["blocked-packages"]["rand"] = ["test_exception", "test_unneeded_exception"]
|
||||
errors = tidy.collect_errors_for_files(iterFile('blocked_package.lock'), [tidy.check_lock], [], print_text=False)
|
||||
|
||||
msg = (
|
||||
"Package test_blocked 0.0.2 depends on blocked package rand."
|
||||
)
|
||||
|
||||
msg2 = (
|
||||
"Package test_unneeded_exception is not required to be an exception of blocked package rand."
|
||||
)
|
||||
|
||||
self.assertEqual(msg, errors.next()[2])
|
||||
self.assertEqual(msg2, errors.next()[2])
|
||||
self.assertNoMoreErrors(errors)
|
||||
|
||||
# needed to not raise errors in other test cases
|
||||
tidy.config["blocked-packages"]["rand"] = []
|
||||
|
||||
def test_lint_runner(self):
|
||||
test_path = base_path + 'lints/'
|
||||
runner = tidy.LintRunner(only_changed_files=False, progress=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue