コード例 #1
0
def load_extensions_dir(dirname):
    """Mount the directory and send all javascript file links to the IDE in order to execute those test urls under the jsUnit framework"""
    # Mount the fileserver application for tests
    from windmill.dep import wsgi_fileserver
    WSGIFileServerApplication = wsgi_fileserver.WSGIFileServerApplication
    application = WSGIFileServerApplication(
        root_path=os.path.abspath(dirname),
        mount_point='/windmill-extentions/')
    from windmill.server import wsgi
    wsgi.add_namespace('windmill-extentions', application)
    # Build list of files and send to IDE
    base_url = windmill.settings['TEST_URL'] + '/windmill-extentions'

    js_files = []

    def parse_files(x, directory, files):
        if not os.path.split(directory)[-1].startswith('.'):
            additional_dir = directory.replace(dirname, '')
            js_files.extend(
                [additional_dir + '/' + f for f in files if f.endswith('.js')])

    os.path.walk(dirname, parse_files, 'x')

    xmlrpc_client.add_command({
        'method': 'commands.loadExtensions',
        'params': {
            'extensions': [base_url + f for f in js_files]
        }
    })
コード例 #2
0
def run_js_tests(js_dir, test_filter=None, phase=None):
    import windmill
    windmill.js_framework_active = True
    js_dir = os.path.abspath(os.path.expanduser(js_dir))
    from windmill.dep import wsgi_fileserver
    WSGIFileServerApplication = wsgi_fileserver.WSGIFileServerApplication
    application = WSGIFileServerApplication(root_path=os.path.abspath(js_dir),
                                            mount_point='/windmill-jstest/')
    from windmill.server import wsgi
    wsgi.add_namespace('windmill-jstest', application)
    # Build list of files and send to IDE
    base_url = windmill.settings['TEST_URL'] + '/windmill-jstest'

    js_files = []

    def parse_files(x, directory, files):
        if not os.path.split(directory)[-1].startswith('.'):
            additional_dir = directory.replace(js_dir, '')
            js_files.extend(
                [additional_dir + '/' + f for f in files if f.endswith('.js')])

    os.path.walk(js_dir, parse_files, 'x')

    kwargs = {}
    kwargs['files'] = [base_url + f for f in js_files]
    kwargs['uuid'] = str(uuid.uuid1())
    if test_filter:
        kwargs['filter'] = test_filter
    if phase:
        kwargs['phase'] = phase
    xmlrpc_client.add_command({'method': 'commands.jsTests', 'params': kwargs})
コード例 #3
0
ファイル: shell_objects.py プロジェクト: d5h/windmill
def run_js_tests(js_dir, test_filter=None, phase=None):
    import windmill
    windmill.js_framework_active = True
    js_dir = os.path.abspath(os.path.expanduser(js_dir))
    from windmill.dep import wsgi_fileserver  
    WSGIFileServerApplication = wsgi_fileserver.WSGIFileServerApplication
    application = WSGIFileServerApplication(root_path=os.path.abspath(js_dir), mount_point='/windmill-jstest/')
    from windmill.server import wsgi
    wsgi.add_namespace('windmill-jstest', application)
    # Build list of files and send to IDE
    base_url = windmill.settings['TEST_URL']+'/windmill-jstest'
    
    js_files = []
    def parse_files(x, directory, files):
        if not os.path.split(directory)[-1].startswith('.'):
            additional_dir = directory.replace(js_dir, '')
            js_files.extend( [additional_dir+'/'+f for f in files if f.endswith('.js')]  )
    os.path.walk(js_dir, parse_files, 'x')
    
    kwargs = {}
    kwargs['files'] = [base_url+f for f in js_files ]
    kwargs['uuid'] = str(uuid.uuid1())
    if test_filter:
        kwargs['filter'] = test_filter
    if phase:
        kwargs['phase'] = phase
    
    xmlrpc_client.add_command({
      'method':'commands.setOptions',
      'params': {
        'scriptAppendOnly': windmill.settings['SCRIPT_APPEND_ONLY']
      }
    })
    xmlrpc_client.add_command({'method':'commands.jsTests', 'params':kwargs})
コード例 #4
0
ファイル: transforms.py プロジェクト: ept/windmill
def create_saves_path():
    directory = tempfile.mkdtemp(suffix='.windmill-saves')
    # Mount the fileserver application for tests
    from wsgi_fileserver import WSGIFileServerApplication
    application = WSGIFileServerApplication(root_path=os.path.abspath(directory), mount_point='/windmill-saves/')
    from windmill.server import wsgi
    wsgi.add_namespace('windmill-saves', application)
    windmill.settings['SAVES_PATH'] = directory
    windmill.teardown_directories.append(directory)
コード例 #5
0
def create_saves_path():
    directory = tempfile.mkdtemp(suffix='.windmill-saves')
    # Mount the fileserver application for tests
    from windmill.dep import wsgi_fileserver
    WSGIFileServerApplication = wsgi_fileserver.WSGIFileServerApplication
    application = WSGIFileServerApplication(
        root_path=os.path.abspath(directory), mount_point='/windmill-saves/')
    from windmill.server import wsgi
    wsgi.add_namespace('windmill-saves', application)
    windmill.settings['SAVES_PATH'] = directory
    windmill.teardown_directories.append(directory)
コード例 #6
0
ファイル: shell_objects.py プロジェクト: ept/windmill
def load_extensions_dir(dirname):
   """Mount the directory and send all javascript file links to the IDE in order to execute those test urls under the jsUnit framework"""
   # Mount the fileserver application for tests
   from wsgi_fileserver import WSGIFileServerApplication
   application = WSGIFileServerApplication(root_path=os.path.abspath(dirname), mount_point='/windmill-extentions/')
   from windmill.server import wsgi
   wsgi.add_namespace('windmill-extentions', application)
   # Build list of files and send to IDE
   base_url = windmill.settings['TEST_URL']+'/windmill-extentions'

   js_files = []
   def parse_files(x, directory, files):
       if not os.path.split(directory)[-1].startswith('.'):
           additional_dir = directory.replace(dirname, '')
           js_files.extend( [additional_dir+'/'+f for f in files if f.endswith('.js')]  )
   os.path.walk(dirname, parse_files, 'x') 

   xmlrpc_client.add_command({'method':'commands.loadExtensions', 
                              'params':{'extensions':[base_url+f for f in js_files ]}})