Ejemplo n.º 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)
Ejemplo n.º 2
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)
Ejemplo n.º 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)
Ejemplo n.º 4
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)
Ejemplo n.º 5
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)