def tearDown(self): if self.s3ffs: self.s3ffs.stop() MS3Server.stop() shutil.rmtree(self.local, True) shutil.rmtree(self.remote, True)
def setUp(self): self.datadir = get_data_dir('buckets') MS3Server.start(datadir=self.datadir) self.s3 = S3Connection('X', 'Y', is_secure=False, host='localhost', port=9010, calling_format=OrdinaryCallingFormat())
def tearDown(self): if self.s1: self.s1.stop() if self.s2: self.s2.stop() MS3Server.stop() shutil.rmtree(self.l1, True) shutil.rmtree(self.l2, True) shutil.rmtree(self.remote, True)
def setUp(self): self.local = tempfile.mkdtemp() self.remote = tempfile.mkdtemp() self.bucket = "test" os.mkdir(os.path.join(self.remote, self.bucket)) self.s3ffs = None # In case there occurs an exception during setUp(), unittest # doesn't call tearDown(), hence we need to make sure we don't # leave any server processes running. try: MS3Server.start(datadir=self.remote) self.s3ffs = s3ffsServer(self.bucket, mountpoint=self.local).start() except Exception: self.tearDown() raise
def tearDown(self): self.s3.close() MS3Server.stop() cleanup(self.datadir)