aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests
diff options
context:
space:
mode:
authorUK992 <urbankrajnc92@gmail.com>2016-08-09 16:14:43 +0200
committerUK992 <urbankrajnc92@gmail.com>2016-08-12 13:34:38 +0200
commit9a3b61abe1ad633ab723ca6cbb7180a4992ead5a (patch)
treea0f07d159fcfe8f5597338993ee526ede7bb06ec /python/tidy/servo_tidy_tests
parent48ace17b5419a9795a13bded286e113e79d56905 (diff)
downloadservo-9a3b61abe1ad633ab723ca6cbb7180a4992ead5a.tar.gz
servo-9a3b61abe1ad633ab723ca6cbb7180a4992ead5a.zip
Check for blank line after shebang and grab actual comment block instead of hard-coded one
Diffstat (limited to 'python/tidy/servo_tidy_tests')
-rw-r--r--python/tidy/servo_tidy_tests/shebang_license.py4
-rw-r--r--python/tidy/servo_tidy_tests/test_tidy.py5
2 files changed, 9 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/shebang_license.py b/python/tidy/servo_tidy_tests/shebang_license.py
new file mode 100644
index 00000000000..0499f3a93f9
--- /dev/null
+++ b/python/tidy/servo_tidy_tests/shebang_license.py
@@ -0,0 +1,4 @@
+#!/usr/bin/env python
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py
index 888c0faf693..bb1cb8ce61c 100644
--- a/python/tidy/servo_tidy_tests/test_tidy.py
+++ b/python/tidy/servo_tidy_tests/test_tidy.py
@@ -48,6 +48,11 @@ class CheckTidiness(unittest.TestCase):
self.assertEqual('incorrect license', errors.next()[2])
self.assertNoMoreErrors(errors)
+ def test_shebang_license(self):
+ errors = tidy.collect_errors_for_files(iterFile('shebang_license.py'), [], [tidy.check_license], print_text=False)
+ self.assertEqual('missing blank line after shebang', errors.next()[2])
+ self.assertNoMoreErrors(errors)
+
def test_shell(self):
errors = tidy.collect_errors_for_files(iterFile('shell_tidy.sh'), [], [tidy.check_shell], print_text=False)
self.assertEqual('script does not have shebang "#!/usr/bin/env bash"', errors.next()[2])