Bug 1526580 [wpt PR 15248] - Update apiclient, a=testonly
☠☠ backed out by 749b314d6c28 ☠ ☠
authorGeoffrey Sneddon <me@gsnedders.com>
Mon, 18 Feb 2019 19:24:34 +0000
changeset 460257 471b198ee5f94070772e10dc7f5248ae6707ee49
parent 460256 37d17cc8cce5d9a27d53837c5f0bd0ad6c309078
child 460258 d84c9dfa9d2c934d35be98b476b882a6c39a4029
push id112074
push userwptsync@mozilla.com
push dateThu, 21 Feb 2019 19:59:15 +0000
treeherdermozilla-inbound@a15983fcecca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1526580, 15248
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1526580 [wpt PR 15248] - Update apiclient, a=testonly Automatic update from web-platform-tests Squashed 'css/tools/apiclient/' changes from 9d80ee4507..f0e1aa75a7 f0e1aa75a7 Merge pull request #2 from cclauss/modernize-Python-2-codes 08bedeaf9d Use print() function in both Python 2 and Python 3 git-subtree-dir: css/tools/apiclient git-subtree-split: f0e1aa75a7113c2df87ab76cdf6734e77dfbaeb7 -- Merge commit '77ff57a73af15f3ac3743a3eedf59d4acf6d0a41' into update-apiclient -- Merge pull request #15248 from gsnedders/update-apiclient Update apiclient -- wpt-commits: 77ff57a73af15f3ac3743a3eedf59d4acf6d0a41, 83364c672a2c3857fd8fa522327c103f1490155b, edc48a7c1238f7cf8216746cd287a51cce6f0ced wpt-pr: 15248
testing/web-platform/tests/css/tools/apiclient/test.py
--- a/testing/web-platform/tests/css/tools/apiclient/test.py
+++ b/testing/web-platform/tests/css/tools/apiclient/test.py
@@ -6,100 +6,101 @@
 #  This work is distributed under the W3C® Software License [1]
 #  in the hope that it will be useful, but WITHOUT ANY
 #  WARRANTY; without even the implied warranty of
 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
 #  [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
 #
 
+from __future__ import print_function
 import sys
 import os
 import glob
 import json
 import exceptions
 import collections
 
 from apiclient import uritemplate
 from apiclient import apiclient
 
 
 def runTests(testFileSearch):
     for testFilePath in glob.glob(testFileSearch):
-        print 'Running tests from: ' + testFilePath
+        print('Running tests from: ' + testFilePath)
         with open(testFilePath) as testFile:
             testData = json.load(testFile, object_pairs_hook = collections.OrderedDict)
             for testSetName in testData:
-                print testSetName + ':'
+                print(testSetName + ':')
                 testSet = testData[testSetName]
                 vars = testSet['variables']
                 for test in testSet['testcases']:
                     expectedResult = test[1]
                     try:
                         template = uritemplate.URITemplate(test[0])
                     except Exception as e:
                         if (expectedResult):
-                            print '* FAIL: "' + test[0] + '" got: None, expected "' + expectedResult + '"'
+                            print('* FAIL: "' + test[0] + '" got: None, expected "' + expectedResult + '"')
                         else:
-                            print '  PASS: "' + test[0] + '" == None'
+                            print('  PASS: "' + test[0] + '" == None')
                         continue
                     
                     result = template.expand(**vars)
                     if (isinstance(expectedResult, basestring)):
                         if (expectedResult != result):
-                            print '* FAIL: "' + test[0] + '" got: "' + unicode(result) + '", expected "' + expectedResult + '"'
+                            print('* FAIL: "' + test[0] + '" got: "' + unicode(result) + '", expected "' + expectedResult + '"')
                             continue
                     elif (isinstance(expectedResult, list)):
                         for possibleResult in expectedResult:
                             if (possibleResult == result):
                                 break
                         else:
-                            print '* FAIL: "' + test[0] + '" got: "' + unicode(result) + '", expected:'
-                            print " or\n".join(['    "' + possibleResult + '"' for possibleResult in expectedResult])
+                            print('* FAIL: "' + test[0] + '" got: "' + unicode(result) + '", expected:')
+                            print(" or\n".join(['    "' + possibleResult + '"' for possibleResult in expectedResult]))
                             continue
                     elif (not expectedResult):
                         if (result):
-                            print '* FAIL "' + test[0] + '" got: "' + unicode(result) + '", expected None'
+                            print('* FAIL "' + test[0] + '" got: "' + unicode(result) + '", expected None')
                             continue
                     else:
-                        print '** Unknown expected result type: ' + repr(expectedResult)
-                    print '  PASS: "' + test[0] + '" == "' + result + '"'
+                        print('** Unknown expected result type: ' + repr(expectedResult))
+                    print('  PASS: "' + test[0] + '" == "' + result + '"')
 
 def debugHook(type, value, tb):
     if hasattr(sys, 'ps1') or not sys.stderr.isatty():
         # we are in interactive mode or we don't have a tty-like
         # device, so we call the default hook
         sys.__excepthook__(type, value, tb)
     else:
         import traceback, pdb
         # we are NOT in interactive mode, print the exception...
         traceback.print_exception(type, value, tb)
-        print
+        print()
         # ...then start the debugger in post-mortem mode.
         pdb.pm()
 
 
 if __name__ == "__main__":      # called from the command line
     sys.excepthook = debugHook
     
 #    runTests(os.path.join('test', '*.json'))
 
 #    runTests(os.path.join('uritemplate-test', 'spec-examples.json'))
 #    runTests(os.path.join('uritemplate-test', '*.json'))
 ### more tests @ https://github.com/uri-templates/uritemplate-test
 
 
     github = apiclient.APIClient('https://api.github.com/', version = 'vnd.github.beta')
-    print github.get('user_url', user = 'plinss').data
+    print(github.get('user_url', user = 'plinss').data)
 
 #    shepherd = apiclient.APIClient('https://api.csswg.org/shepherd/', version = 'vnd.csswg.shepherd.v1')
     shepherd = apiclient.APIClient('https://test.linss.com/shepherd/api', version = 'vnd.csswg.shepherd.v1')
-    print shepherd.resourceNames
+    print(shepherd.resourceNames)
     specs = shepherd.resource('specifications')
-    print specs.variables
+    print(specs.variables)
 #    print specs.hints.docs
-    print shepherd.get('specifications', spec = 'compositing-1', anchors = False).data
+    print(shepherd.get('specifications', spec = 'compositing-1', anchors = False).data)
 
     suites = shepherd.resource('test_suites')
-    print suites.variables
-    print shepherd.get('test_suites', spec = 'css-shapes-1').data
+    print(suites.variables)
+    print(shepherd.get('test_suites', spec = 'css-shapes-1').data)