def test_bucket_policy(self):
    self.s3_client.create_bucket(Bucket=TEST_BUCKET_NAME_WITH_POLICY)
    policy = {'Version': '2012-10-17', 'Statement': {'Action': ['s3:GetObject'], 'Effect': 'Allow', 'Resource': 'arn:aws:s3:::bucketName/*', 'Principal': {'AWS': ['*']}}}
    response = self.s3_client.put_bucket_policy(Bucket=TEST_BUCKET_NAME_WITH_POLICY, Policy=json.dumps(policy))
    self.assertEqual(response['ResponseMetadata']['HTTPStatusCode'], 204)
    saved_policy = self.s3_client.get_bucket_policy(Bucket=TEST_BUCKET_NAME_WITH_POLICY)['Policy']
    self.assertEqual(json.loads(saved_policy), policy)
def test_bucket_policy(self):
    self.s3_client.create_bucket(Bucket=TEST_BUCKET_NAME_WITH_POLICY)
    policy = {'Version': '2012-10-17', 'Statement': {'Action': ['s3:GetObject'], 'Effect': 'Allow', 'Resource': 'arn:aws:s3:::bucketName/*', 'Principal': {'AWS': ['*']}}}
    response = self.s3_client.put_bucket_policy(Bucket=TEST_BUCKET_NAME_WITH_POLICY, Policy=json.dumps(policy))
    self.assertEqual(response['ResponseMetadata']['HTTPStatusCode'], 204)
    saved_policy = self.s3_client.get_bucket_policy(Bucket=TEST_BUCKET_NAME_WITH_POLICY)['Policy']
    self.assertEqual(json.loads(saved_policy), policy)