def test_upload_stack(): conf_path = BEES_ROOT.child('project.yaml') conf = yaml.load(File(conf_path).read_all()) conf['file_path'] = conf_path uploaded = stack.upload_stack(conf)['result'] bucket_name = conf['publish']['bucket'] bucket = Bucket(bucket_name) bucket.connect() bucket.set_policy() for rpath, info in uploaded.iteritems(): response = urllib2.urlopen(info.url) html = response.read() source_text = File(info.target).read_all() assert_text_equals(html, source_text)
def make_bucket(self, bucket_name, error='404.html', make_route=False): bucket = Bucket(bucket_name, aws_access_key_id=self.config.awskeys.access_key, aws_secret_access_key=self.config.awskeys.secret) bucket.make() bucket.set_policy() bucket.serve(error=error) if make_route: route = self.get_route() try: route.add_route_to_bucket(bucket_name) except: pass return bucket