Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3436)

Unified Diff: bower_components/web-animations-js/test/update-testcases.py

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: bower_components/web-animations-js/test/update-testcases.py
diff --git a/bower_components/web-animations-js/test/update-testcases.py b/bower_components/web-animations-js/test/update-testcases.py
deleted file mode 100755
index 5f4955688d82a706d8a9ea814f19265f1c3b9202..0000000000000000000000000000000000000000
--- a/bower_components/web-animations-js/test/update-testcases.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/python
-
-import cStringIO as StringIO
-from fnmatch import fnmatch
-import difflib
-import os
-import sys
-
-
-def get_name(filename):
- return os.path.splitext(filename)[0]
-
-
-def list_dir(dir_path, filter_func):
- return sorted(filter(filter_func, os.listdir(dir_path)), key=get_name)
-
-
-def main():
- test_dir = os.path.dirname(os.path.realpath(__file__))
- testcase_dir = os.path.join(test_dir, 'testcases')
- testcase_file = os.path.join(test_dir, 'testcases.js')
-
- def is_testcase_file(filename):
- return (
- fnmatch(filename, "*.html") and
- not fnmatch(filename, "manual-test*") and
- not fnmatch(filename, "disabled-*"))
-
- new_testcases = StringIO.StringIO()
- new_testcases.write("""\
-// This file is automatically generated by test/update-testcases.py.
-// Disable tests by adding them to test/disabled-testcases
-""")
- new_testcases.write('var tests = [\n \'')
- new_testcases.write(
- '\',\n \''.join(list_dir(testcase_dir, is_testcase_file)))
- new_testcases.write('\',\n];\n')
- new_testcases.seek(0)
- new_testcases_lines = new_testcases.readlines()
-
- current_testcases_lines = file(testcase_file).readlines()
-
- lines = list(difflib.unified_diff(
- current_testcases_lines, new_testcases_lines,
- fromfile=testcase_file, tofile=testcase_file))
-
- if len(lines) == 0:
- sys.stdout.write('Nothing to do\n')
- sys.exit(0)
-
- if not "--dry-run" in sys.argv:
- file(testcase_file, "w").write("".join(new_testcases_lines))
- sys.stdout.write(
- 'Updating %s with the following diff.\n' % testcase_file)
-
- for line in lines:
- sys.stdout.write(line)
-
- sys.exit(1)
-
-
-if __name__ == '__main__':
- main()

Powered by Google App Engine
This is Rietveld 408576698