コード例 #1
0
def setup_quickstart(template, templates, template_vars, args):
    command = CreateDistroCommand('MokshaQuickStartUnitTest')
    command.verbose = False
    command.simulate = False
    command.options = Options()
    command.interactive = False
    command.args = [
        'mokshatest',
        '--package=mokshatest',
        '--template=moksha.master',
    ]
    for t in templates:
        command.args.append('--template=%s' % t)

    for arg in args:
        command.args.append('%s=%s' % (arg, args[arg]))

    proj_dir = os.path.join(testDataPath, 'mokshatest')
    command.create_template(template('mokshatest'), proj_dir, template_vars)
    command.command()

    subprocess.Popen('paver egg_info',
                     shell=True,
                     stdout=subprocess.PIPE,
                     stderr=subprocess.PIPE,
                     cwd=proj_dir).communicate()

    pkg_resources.working_set.add_entry(proj_dir)
    reload(pkg_resources)

    app = loadapp('config:%s' % get_moksha_dev_config(), relative_to=proj_dir)
    return TestApp(app)
コード例 #2
0
ファイル: base.py プロジェクト: lmacken/moksha
def setup_quickstart(template, templates, template_vars, args):
    command = CreateDistroCommand('MokshaQuickStartUnitTest')
    command.verbose = False
    command.simulate = False
    command.options = Options()
    command.interactive=False
    command.args=[
            'mokshatest', '--package=mokshatest',
            '--template=moksha.master',
            ]
    for t in templates:
        command.args.append('--template=%s' % t)

    for arg in args:
        command.args.append('%s=%s' % (arg, args[arg]))

    proj_dir = os.path.join(testDataPath, 'mokshatest')
    command.create_template(
            template('mokshatest'),
            proj_dir,
            template_vars)
    command.command()

    subprocess.Popen('paver egg_info', shell=True, stdout=subprocess.PIPE,
                     stderr=subprocess.PIPE,
                     cwd=proj_dir).communicate()

    pkg_resources.working_set.add_entry(proj_dir)
    reload(pkg_resources)

    app = loadapp('config:%s' % get_moksha_dev_config(),
                  relative_to=proj_dir)
    return TestApp(app)
コード例 #3
0
def setup():
    global app
    command = CreateDistroCommand("name")
    command.verbose = True
    command.simulate = False
    command.options = MochOptions()
    command.interactive = False
    command.args = ["TGTest"]
    command.args.append("sqlalchemy=%s" % True)
    command.args.append("sqlobject=%s" % False)
    command.args.append("identity=%s" % False)
    print command
    command.templates = TurboGearsTemplate("TGTest")
    command.create_template(
        TurboGearsTemplate("TGTest"),
        testDataPath + "/TGTest",
        {"package": "TGTest", "project": "tgtest", "egg": "tgtest"},
    )
    command.command()
    here_dir = os.path.dirname(os.path.abspath(__file__))
    proj_dir = testDataPath + "/TGTest"

    pkg_resources.working_set.add_entry(proj_dir)
    app = loadapp("config:development.ini", relative_to=proj_dir)
    app = TestApp(app)
コード例 #4
0
def create_distro_command(interactive=True, args=None):
    """ front-end the CreateDistro command"""
    command = CreateDistroCommand('create')
    command.verbose = 0
    command.simulate = False
    command.interactive = interactive
    command.parse_args(args or [])
    return command
コード例 #5
0
ファイル: command.py プロジェクト: nyuhuhuu/trachacks
def create_distro_command(interactive=True, args=None):
    """ front-end the CreateDistro command"""
    command = CreateDistroCommand('create')
    command.verbose = 0
    command.simulate = False
    command.interactive = interactive
    command.parse_args(args or [])
    return command
コード例 #6
0
    def setUp(self):
        command = CreateDistroCommand('TGQuickStartUnitTest')
        command.verbose = False
        command.simulate = False
        command.options = MochOptions()
        command.interactive = False
        command.args = ['TGTest', 'cookiesecret=ChangeME']

        proj_dir = os.path.join(testDataPath, 'TGTest')
        command.create_template(TurboGearsTemplate('TGTest'), proj_dir,
                                self.template_vars)
        command.command()

        pkg_resources.working_set.add_entry(proj_dir)
        self.app = loadapp('config:development.ini', relative_to=proj_dir)
        self.app = TestApp(self.app)
コード例 #7
0
    def setUp(self):
        command = CreateDistroCommand('TGQuickStartUnitTest')
        command.verbose = False
        command.simulate = False
        command.options = MochOptions()
        command.interactive=False
        command.args=['TGTest', 'cookiesecret=ChangeME']

        proj_dir = os.path.join(testDataPath, 'TGTest')
        command.create_template(
                TurboGearsTemplate('TGTest'),
                proj_dir,
                self.template_vars)
        command.command()
        
        pkg_resources.working_set.add_entry(proj_dir)
        self.app = loadapp('config:development.ini', relative_to=proj_dir)
        self.app = TestApp(self.app)