def _init_project(self, import_templates=None):
        self.project_path = os.path.join(
            self.tester.env.env_path, 'projects', 'test')

        backend = [b for b in self.tester.backends if
            b.conn_info.backend == 'sqlite'][0]

        project = project_manager.create_project(
            self.tester.env, self.project_path,
            conn_string=backend.conn_info.conn_string,
            overwrite=True, initialize=False)

        return project_manager.Project(self.project_path, self.tester.env)
Example #2
0
    def _init_project(self, import_templates=None):
        self.project_path = os.path.join(self.tester.env.env_path, 'projects',
                                         'test')

        backend = [
            b for b in self.tester.backends if b.conn_info.backend == 'sqlite'
        ][0]

        project = project_manager.create_project(
            self.tester.env,
            self.project_path,
            conn_string=backend.conn_info.conn_string,
            overwrite=True,
            initialize=False)

        return project_manager.Project(self.project_path, self.tester.env)
    def _init_project(self, import_templates):
        self.project_path = os.path.join(
            self.tester.env.env_path, 'projects', 'test')

        backend = [b for b in self.tester.backends if
            b.conn_info.backend == 'sqlite'][0]

        project = project_manager.create_project(
            self.tester.env, self.project_path,
            conn_string=backend.conn_info.conn_string,
            overwrite=True, initialize=False)

        # Prepare the project
        put_file(
            join(self.project_path, 'manager', 'imports_config.py'),
            'import_templates = {0!r}'.format(import_templates))

        return project_manager.Project(self.project_path, self.tester.env)
Example #4
0
    def _init_project(self, import_templates):
        self.project_path = os.path.join(self.tester.env.env_path, 'projects',
                                         'test')

        backend = [
            b for b in self.tester.backends if b.conn_info.backend == 'sqlite'
        ][0]

        project = project_manager.create_project(
            self.tester.env,
            self.project_path,
            conn_string=backend.conn_info.conn_string,
            overwrite=True,
            initialize=False)

        # Prepare the project
        put_file(join(self.project_path, 'manager', 'imports_config.py'),
                 'import_templates = {0!r}'.format(import_templates))

        return project_manager.Project(self.project_path, self.tester.env)
Example #5
0
    def setUpClass(cls):
        log.info('setupClass %s, with backend %s', cls.__name__, cls.backend)

        project_path = os.path.join(cls.env.env_path, 'projects', 'test')

        if cls.no_init:
            cls.project = project_manager.Project(project_path, cls.env)
            return

        daemon.Daemon.kill_existing(cls.env)

        log.info('Creating project')
        cls.project = project_manager.create_project(
            cls.env, project_path, system_packages=cls.system_packages,
            conn_string=cls.backend.conn_info.conn_string,
            overwrite=True)

        cls.init_project(cls.project)
        log.info('Running daemon for tests')
        cls.project.rundaemon(block=cls.daemon_only)
Example #6
0
    def setUpClass(cls):
        log.info('setupClass %s, with backend %s', cls.__name__, cls.backend)

        project_path = os.path.join(cls.env.env_path, 'projects', 'test')

        if cls.no_init:
            cls.project = project_manager.Project(project_path, cls.env)
            return

        daemon.Daemon.kill_existing(cls.env)

        log.info('Creating project')
        cls.project = project_manager.create_project(
            cls.env,
            project_path,
            system_packages=cls.system_packages,
            conn_string=cls.backend.conn_info.conn_string,
            overwrite=True)

        cls.init_project(cls.project)
        log.info('Running daemon for tests')
        cls.project.rundaemon(block=cls.daemon_only)
Example #7
0
def create_project(args, env):
    project_manager.create_project(
        env, args.path, args.system_packages, args.conn_string,
        overwrite=args.overwrite)