import shutil
import sys
import tarfile
-import urllib
from testrunner.local import testsuite
+from testrunner.local import utils
from testrunner.objects import testcase
def GetSourceForTest(self, testcase):
filename = os.path.join(self.root, TEST_NAME,
'lib', 'tests', testcase.path + '.js')
- return 'print("FAIL: fail");'
with open(filename) as f:
return f.read()
directory = os.path.join(self.root, TEST_NAME)
if not os.path.exists(archive):
print('Downloading {0} from {1} ...'.format(TEST_NAME, TEST_URL))
- urllib.urlretrieve(TEST_URL, archive)
+ utils.URLRetrieve(TEST_URL, archive)
if os.path.exists(directory):
shutil.rmtree(directory)
os.mkdir(directory)
path = os.path.join(directory, SINON_FILENAME)
if not os.path.exists(path):
- urllib.urlretrieve(SINON_URL, path)
+ utils.URLRetrieve(SINON_URL, path)
hash = hashlib.sha256()
with open(path, 'rb') as f:
for chunk in iter(lambda: f.read(8192), ''):