Ejemplo n.º 1
0
def _config_localize(file_config_combined, file_config_localized):
    # Compile our configuration into a localized version
    jinja2_environment = jinja2.Environment(
        loader=jinja2.FileSystemLoader(searchpath='.'),
        undefined=jinja2.StrictUndefined)
    template = jinja2_environment.get_template(file_config_combined)
    with open(file_config_localized, 'w') as f:
        f.write(template.render({'DOCKER_IP': docker_base.ip()}))
Ejemplo n.º 2
0
    def test_connect_couchdb(self):
        response = requests.get(
            'http://{}:5984'.format(
                docker_base.ip()
            )
        )

        print(response.content)

        self.assertEqual(
            response.status_code,
            200
        )
def setup():
    # Parse our couchdb secrets
    with open('tests/test-secrets/couchdb_secrets.yml') as f:
        couchdb_secrets = yaml.safe_load(f)

    # Create our admin object
    admin = tractdb.server.accounts.AccountsAdmin(
        couchdb_url='http://{}:5984'.format(docker_base.ip()),
        couchdb_admin=couchdb_secrets['admin']['user'],
        couchdb_admin_password=couchdb_secrets['admin']['password'])

    # Create the account we expect
    if TEST_ACCOUNT not in admin.list_accounts():
        admin.create_account(TEST_ACCOUNT, TEST_ACCOUNT_PASSWORD)
Ejemplo n.º 4
0
def docker_machine_docker_localize():
    # Parse our compile config
    with open('_compile-config.yml') as f:
        compile_config_yaml = yaml.safe_load(f)

    # Compile files that need their docker-related information localized
    for jinja2_entry in compile_config_yaml['compile_docker_localize']['entries']:
        jinja2_environment = jinja2.Environment(
            loader=jinja2.FileSystemLoader(searchpath='.'),
            undefined=jinja2.StrictUndefined
        )
        template = jinja2_environment.get_template(jinja2_entry['in'])
        with open(jinja2_entry['out'], 'w') as f:
            f.write(template.render({
                'DOCKER_LOCALIZE_CWD': os.path.normpath(os.getcwd()).replace('\\', '/'),
                'DOCKER_LOCALIZE_IP': docker_base.ip()
            }))
Ejemplo n.º 5
0
def docker_machine_docker_localize():
    # Parse our compile config
    with open('_compile-config.yml') as f:
        compile_config_yaml = yaml.safe_load(f)

    # Compile files that need their docker-related information localized
    for jinja2_entry in compile_config_yaml['compile_docker_localize'][
            'entries']:
        jinja2_environment = jinja2.Environment(
            loader=jinja2.FileSystemLoader(searchpath='.'),
            undefined=jinja2.StrictUndefined)
        template = jinja2_environment.get_template(jinja2_entry['in'])
        with open(jinja2_entry['out'], 'w') as f:
            f.write(
                template.render({
                    'DOCKER_LOCALIZE_CWD':
                    os.path.normpath(os.getcwd()).replace('\\', '/'),
                    'DOCKER_LOCALIZE_IP':
                    docker_base.ip()
                }))
Ejemplo n.º 6
0
    def test_connect_couchdb(self):
        response = requests.get('http://{}:5984'.format(docker_base.ip()))

        print(response.content)

        self.assertEqual(response.status_code, 200)
Ejemplo n.º 7
0
def docker_machine_ip():
    print(docker_base.ip())
Ejemplo n.º 8
0
def docker_machine_ip():
    print(docker_base.ip())