aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests/test_tidy.py
diff options
context:
space:
mode:
authorMaxim Novikov <mnovikov.work@gmail.com>2017-11-21 19:21:07 +0100
committerMaxim Novikov <mnovikov.work@gmail.com>2017-11-21 21:08:14 +0100
commite6d9fd8a4ff9351d5e06c092a9ddc43de5cb73b8 (patch)
treef6c466f678354c831b04555ca7b24a9e4cb38d84 /python/tidy/servo_tidy_tests/test_tidy.py
parent83c7f80baacaa41fe12d1e43ceecce700e490da9 (diff)
downloadservo-e6d9fd8a4ff9351d5e06c092a9ddc43de5cb73b8.tar.gz
servo-e6d9fd8a4ff9351d5e06c092a9ddc43de5cb73b8.zip
Report an errror if a package has duplicates allowed but there are no duplicates
Resolves: #19306
Diffstat (limited to 'python/tidy/servo_tidy_tests/test_tidy.py')
-rw-r--r--python/tidy/servo_tidy_tests/test_tidy.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py
index 3826e4537b5..dd4c06db4c0 100644
--- a/python/tidy/servo_tidy_tests/test_tidy.py
+++ b/python/tidy/servo_tidy_tests/test_tidy.py
@@ -233,6 +233,24 @@ class CheckTidiness(unittest.TestCase):
self.assertEqual(msg2, errors.next()[2])
self.assertNoMoreErrors(errors)
+ def test_lock_ignore_without_duplicates(self):
+ tidy.config["ignore"]["packages"] = ["test", "test2", "test3", "test5"]
+ errors = tidy.collect_errors_for_files(iterFile('duplicated_package.lock'), [tidy.check_lock], [], print_text=False)
+
+ msg = (
+ "duplicates for `test2` are allowed, but only single version found"
+ "\n\t\x1b[93mThe following packages depend on version 0.1.0 from 'https://github.com/user/test2':\x1b[0m"
+ )
+ self.assertEqual(msg, errors.next()[2])
+
+ msg2 = (
+ "duplicates for `test5` are allowed, but only single version found"
+ "\n\t\x1b[93mThe following packages depend on version 0.1.0 from 'https://github.com/':\x1b[0m"
+ )
+ self.assertEqual(msg2, errors.next()[2])
+
+ self.assertNoMoreErrors(errors)
+
def test_lint_runner(self):
test_path = base_path + 'lints/'
runner = tidy.LintRunner(only_changed_files=False, progress=False)