def app(): # this is to make sure sqlite is initialized # for every unittest from indexd import default_settings reload(default_settings) yield get_app() try: clear_database() except: pass
def index_client(indexd_server): """ Handles getting all the docs from an indexing endpoint. Currently this is changing from signpost to indexd, so we'll use just indexd_client now. I.E. test to a common interface this could be multiply our tests: https://docs.pytest.org/en/latest/fixture.html#parametrizing-fixtures """ setup_database() client = Gen3Index(indexd_server.baseurl, create_user("admin", "admin"), service_location="") yield client clear_database()
def drs_client(indexd_server): """ Returns a DrsClient. This will delete any documents, aliases, or users made by this client after the test has completed. Currently the default user is the admin user Runs once per test. """ try: user = create_user("user", "user") except Exception: user = ("user", "user") client = DrsClient(baseurl=indexd_server.baseurl, auth=user) yield client clear_database()