Mercurial > pydertron
comparison test_pydertron.py @ 16:9426f9fa6dc0
Added docs.
| author | Atul Varma <varmaa@toolness.com> |
|---|---|
| date | Thu, 10 Sep 2009 14:55:24 -0700 |
| parents | f30bd92e2216 |
| children |
comparison
equal
deleted
inserted
replaced
| 15:f30bd92e2216 | 16:9426f9fa6dc0 |
|---|---|
| 1 """ | |
| 2 CommonJS SecurableModule standard compliance tests for Pydertron. | |
| 3 """ | |
| 4 | |
| 1 import os | 5 import os |
| 2 import sys | 6 import sys |
| 3 | 7 |
| 4 import pydermonkey | 8 import pydermonkey |
| 5 from pydertron import JsSandbox, jsexposed | 9 from pydertron import JsSandbox, jsexposed |
| 6 from pydertron import SandboxedFileSystem, HttpFileSystem | 10 from pydertron import LocalFileSystem, HttpFileSystem |
| 7 | 11 |
| 8 def run_test(name, fs): | 12 def run_test(name, fs): |
| 9 sandbox = JsSandbox(fs) | 13 sandbox = JsSandbox(fs) |
| 10 stats = {'pass': 0, 'fail': 0, 'info': 0} | 14 stats = {'pass': 0, 'fail': 0, 'info': 0} |
| 11 | 15 |
| 59 fsfactory = HttpFileSystem | 63 fsfactory = HttpFileSystem |
| 60 else: | 64 else: |
| 61 dirs = [(os.path.join(base_libpath, name), name) | 65 dirs = [(os.path.join(base_libpath, name), name) |
| 62 for name in os.listdir(base_libpath) | 66 for name in os.listdir(base_libpath) |
| 63 if name not in ['.svn', 'ORACLE']] | 67 if name not in ['.svn', 'ORACLE']] |
| 64 fsfactory = SandboxedFileSystem | 68 fsfactory = LocalFileSystem |
| 65 | 69 |
| 66 totals = {'pass': 0, 'fail': 0} | 70 totals = {'pass': 0, 'fail': 0} |
| 67 | 71 |
| 68 for libpath, name in dirs: | 72 for libpath, name in dirs: |
| 69 fs = fsfactory(libpath) | 73 fs = fsfactory(libpath) |
