# Path: src/franz/openrdf/tests/tests.py
# AG_HOST = os.environ.get('AGRAPH_HOST', LOCALHOST)
# 
# AG_PORT = int(os.environ.get('AGRAPH_PORT', '10035'))
# 
# AG_PROXY = os.environ.get('AGRAPH_PROXY')
# 
# STORE = 'agraph_test'
# 
# CATALOG = os.environ.get('AGRAPH_CATALOG', 'tests')
# 
# USER = os.environ.get('AGRAPH_USER', 'test')
# 
# PASSWORD = os.environ.get('AGRAPH_PASSWORD', 'xyzzy')


import random
import uuid
import pytest
import requests
import contextlib, os, threading
import six
from collections import MutableMapping
from franz.openrdf.model import URI
from franz.openrdf.repository import Repository
from franz.openrdf.repository.attributes import AttributeDefinition
from franz.openrdf.sail import AllegroGraphServer
from .tests import AG_HOST, AG_PORT, AG_PROXY, STORE, CATALOG, USER, PASSWORD
from six.moves import BaseHTTPServer
        connection.setUserAttributes({})
        connection.clearAttributeFilter()
        connection.clear()
        connection.clearNamespaces()
        connection.disableDuplicateSuppression()
        for attr in connection.getAttributeDefinitions():
            connection.deleteAttributeDefinition(attr.name)

    with connection:
        yield connection


# noinspection PyShadowingNames
@pytest.fixture
def repo_name(conn):
    """
    Make sure that a repository exists and is empty.

    Return the name of that repository.
    """
    name = conn.repository.database_name
    conn.close()
    return name


@pytest.fixture
def server():
    """
    A fixture that allows easy access to an AllegroGraphServer object.
    """

# Path: src/franz/openrdf/tests/tests.py
# AG_HOST = os.environ.get('AGRAPH_HOST', LOCALHOST)
# 
# AG_PORT = int(os.environ.get('AGRAPH_PORT', '10035'))
# 
# AG_PROXY = os.environ.get('AGRAPH_PROXY')
# 
# STORE = 'agraph_test'
# 
# CATALOG = os.environ.get('AGRAPH_CATALOG', 'tests')
# 
# USER = os.environ.get('AGRAPH_USER', 'test')
# 
# PASSWORD = os.environ.get('AGRAPH_PASSWORD', 'xyzzy')


# Path: src/franz/openrdf/tests/conftest.py
import random
import uuid
import pytest
import requests
import contextlib, os, threading
import six
from collections import MutableMapping
from franz.openrdf.model import URI
from franz.openrdf.repository import Repository
from franz.openrdf.repository.attributes import AttributeDefinition
from franz.openrdf.sail import AllegroGraphServer
from .tests import AG_HOST, AG_PORT, AG_PROXY, STORE, CATALOG, USER, PASSWORD
from six.moves import BaseHTTPServer

        connection.setUserAttributes({})
        connection.clearAttributeFilter()
        connection.clear()
        connection.clearNamespaces()
        connection.disableDuplicateSuppression()
        for attr in connection.getAttributeDefinitions():
            connection.deleteAttributeDefinition(attr.name)

    with connection:
        yield connection


# noinspection PyShadowingNames
@pytest.fixture
def repo_name(conn):
    """
    Make sure that a repository exists and is empty.

    Return the name of that repository.
    """
    name = conn.repository.database_name
    conn.close()
    return name


@pytest.fixture
def server():
    """
    A fixture that allows easy access to an AllegroGraphServer object.
    """

    yield AllegroGraphServer(AG_HOST, AG_PORT, USER, PASSWORD, proxy=AG_PROXY)