def populate(): populate_steps() populate_states() populate_users(get_default_users()) populate_articles() populate_organization_types( [u'corporation', u'direction', u'service', u'site']) csv_file = os.path.join('data', 'fixtures', 'organizations.csv') populate_organizations(resource_filename(csv_file)) csv_file = os.path.join('data', 'fixtures', 'domains.csv') import_domains_csv(resource_stream(csv_file)) csv_file = os.path.join('data', 'fixtures', 'improvement_domains.csv') import_improvement_domains_csv(resource_stream(csv_file)) csv_file = os.path.join('data', 'fixtures', 'article_topics.csv') import_article_topics_csv(resource_stream(csv_file))
def test_resource_path(*path_elements): test_dir = resource_filename(os.path.join('eureka', 'tests', 'data')) return os.path.join(test_dir, *path_elements)
import posixpath from configobj import ConfigObj from fabric.api import (cd, env, execute, hosts, lcd, local, put, run, settings, sudo, task) from fabric.contrib import files from eureka.domain import populate from eureka.domain.populate import get_or_create_organization from eureka.pkg import resource_filename from eureka.infrastructure.unicode_csv import UnicodeDictReader from nagare import database from nagare.admin.db import read_options from nagare.admin.serve import publisher_options_spec from nagare.admin.util import read_application from settings import demo, integration, localhost root_dir = resource_filename('') @task def int(): execute(integration) def _get_config_filepath(): return os.path.join(root_dir, 'etc', 'eureka.cfg') @contextmanager def dbcontext(): for (database_settings, _) in read_options(True, [_get_config_filepath()], ValueError):
from configobj import ConfigObj from fabric.api import ( cd, env, execute, hosts, lcd, local, put, run, settings, sudo, task ) from fabric.contrib import files from eureka.domain import populate from eureka.domain.populate import get_or_create_organization from eureka.pkg import resource_filename from eureka.infrastructure.unicode_csv import UnicodeDictReader from nagare import database from nagare.admin.db import read_options from nagare.admin.serve import publisher_options_spec from nagare.admin.util import read_application from settings import demo, integration, localhost root_dir = resource_filename('') @task def int(): execute(integration) def _get_config_filepath(): return os.path.join(root_dir, 'etc', 'eureka.cfg') @contextmanager def dbcontext(): for (database_settings, _) in read_options( True, [_get_config_filepath()], ValueError):