def setUp(self):
     """Establish a clean test environment"""
     self.stubs = stubout.StubOutForTesting()
     stubs.stub_out_registry_and_store_server(self.stubs)
     stubs.stub_out_registry_db_image_api(self.stubs)
     stubs.stub_out_filesystem_backend()
     self.api = rserver.API({"verbose": VERBOSE, "debug": DEBUG})
Beispiel #2
0
 def setUp(self):
     """Establish a clean test environment"""
     self.stubs = stubout.StubOutForTesting()
     stubs.stub_out_registry_db_image_api(self.stubs)
     stubs.stub_out_registry_and_store_server(self.stubs)
     stubs.stub_out_filesystem_backend()
     self.client = client.Client("0.0.0.0", doc_root="")
    def setUp(self):
        """Establish a clean test environment"""
        # NOTE(sirp): in-memory DBs don't play well with sqlalchemy migrate
        # (see http://code.google.com/p/sqlalchemy-migrate/
        #            issues/detail?id=72)
        self.db_file = "test_glance_api.sqlite"
        os.environ["GLANCE_SQL_CONNECTION"] = "sqlite:///%s" % self.db_file

        self.stubs = stubout.StubOutForTesting()
        stubs.stub_out_registry_and_store_server(self.stubs)
        stubs.stub_out_registry_db_image_api(self.stubs)
        stubs.stub_out_filesystem_backend()
        sql_connection = os.environ.get("GLANCE_SQL_CONNECTION", "sqlite://")
        options = {
            "verbose": VERBOSE,
            "debug": DEBUG,
            "registry_host": "0.0.0.0",
            "registry_port": "9191",
            "sql_connection": sql_connection,
            "default_store": "file",
            "filesystem_store_datadir": stubs.FAKE_FILESYSTEM_ROOTDIR,
        }
        self.api = server.API(options)
 def setUp(self):
     """Establish a clean test environment"""
     self.stubs = stubout.StubOutForTesting()
     stubs.stub_out_filesystem_backend()
     self.orig_chunksize = ChunkedFile.CHUNKSIZE
     ChunkedFile.CHUNKSIZE = 10