aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests/test_tidy.py
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-10-02 12:00:36 -0500
committerGitHub <noreply@github.com>2016-10-02 12:00:36 -0500
commit3a5fd8b49a45b4647e9823d3e10243d9f4b2277b (patch)
tree91b1b2a70305f26c4bbf88a9687f15c799fb0209 /python/tidy/servo_tidy_tests/test_tidy.py
parentc4021a6765661335080b05f713d3571a8286ef3a (diff)
parent62d98821856f8610c78712f8e0baef5c330fb1f9 (diff)
downloadservo-3a5fd8b49a45b4647e9823d3e10243d9f4b2277b.tar.gz
servo-3a5fd8b49a45b4647e9823d3e10243d9f4b2277b.zip
Auto merge of #13447 - gterzian:check_webidls_folder_files, r=Wafflespeanut
Have tidy ensure that the there are no extra files in the webidls folder #13427 <!-- Please describe your changes on the following line: --> Have tidy ensure that the there are no extra files in the webidls folder #13427 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13427 (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13447) <!-- Reviewable:end -->
Diffstat (limited to 'python/tidy/servo_tidy_tests/test_tidy.py')
-rw-r--r--python/tidy/servo_tidy_tests/test_tidy.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py
index 4bf21cfa5e4..dca0c5765b1 100644
--- a/python/tidy/servo_tidy_tests/test_tidy.py
+++ b/python/tidy/servo_tidy_tests/test_tidy.py
@@ -9,6 +9,7 @@
import os
import unittest
+
from servo_tidy import tidy
base_path = 'servo_tidy_tests/' if os.path.exists('servo_tidy_tests/') else 'python/tidy/servo_tidy_tests/'
@@ -30,6 +31,17 @@ class CheckTidiness(unittest.TestCase):
self.assertEqual('invalid config table [wrong]', errors.next()[2])
self.assertNoMoreErrors(errors)
+ def test_directory_checks(self):
+ dirs = {
+ os.path.join(base_path, "dir_check/webidl_plus"): ['webidl', 'test'],
+ os.path.join(base_path, "dir_check/only_webidl"): ['webidl']
+ }
+ errors = tidy.check_directory_files(dirs)
+ error_dir = os.path.join(base_path, "dir_check/webidl_plus")
+ self.assertEqual("Unexpected extension found for test.rs. We only expect files with webidl, test extensions in {0}".format(error_dir), errors.next()[2])
+ self.assertEqual("Unexpected extension found for test2.rs. We only expect files with webidl, test extensions in {0}".format(error_dir), errors.next()[2])
+ self.assertNoMoreErrors(errors)
+
def test_spaces_correctnes(self):
errors = tidy.collect_errors_for_files(iterFile('wrong_space.rs'), [], [tidy.check_by_line], print_text=False)
self.assertEqual('trailing whitespace', errors.next()[2])