aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests/test_tidy.py
diff options
context:
space:
mode:
authoraskeing <askeing@gmail.com>2016-04-17 04:20:24 +0900
committeraskeing <askeing@gmail.com>2016-04-17 04:20:24 +0900
commit27bac667b21a89a717408b36b14c78d0bdd19a9c (patch)
treed2eacfbd6f69b3fc4964d21f6e0095d70017eadb /python/tidy/servo_tidy_tests/test_tidy.py
parent22d991d4e0b39dd0cb8d05215e181ac8ef957aab (diff)
downloadservo-27bac667b21a89a717408b36b14c78d0bdd19a9c.tar.gz
servo-27bac667b21a89a717408b36b14c78d0bdd19a9c.zip
Modified test_spec_link of test_tidy for packaged tidy
Diffstat (limited to 'python/tidy/servo_tidy_tests/test_tidy.py')
-rw-r--r--python/tidy/servo_tidy_tests/test_tidy.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py
index a183e6a798d..031e0873a56 100644
--- a/python/tidy/servo_tidy_tests/test_tidy.py
+++ b/python/tidy/servo_tidy_tests/test_tidy.py
@@ -11,10 +11,11 @@ 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/'
+
def iterFile(name):
- path = 'servo_tidy_tests/' if os.path.exists('servo_tidy_tests/') else 'python/tidy/servo_tidy_tests/'
- return iter([os.path.join(path, name)])
+ return iter([os.path.join(base_path, name)])
class CheckTidiness(unittest.TestCase):
@@ -62,7 +63,7 @@ class CheckTidiness(unittest.TestCase):
self.assertEqual('use &str instead of &String', errors.next()[2])
def test_spec_link(self):
- tidy.spec_base_path = "python/tidy_self_test/"
+ tidy.spec_base_path = base_path
errors = tidy.collect_errors_for_files(iterFile('speclink.rs'), [], [tidy.check_spec])
self.assertEqual('method declared in webidl is missing a comment with a specification link', errors.next()[2])