Beispiel #1
0
 def test_invalid_char_in_bucket_raises_exception(self):
     params = {
         'Bucket': 'bad/bucket/name',
         'Key': 'foo',
         'Body': b'asdf',
     }
     with self.assertRaises(ParamValidationError):
         handlers.validate_bucket_name(params)
Beispiel #2
0
 def test_bucket_too_long_raises_exception(self):
     params = {
         'Bucket': 'a' * 300,
         'Key': 'foo',
         'Body': b'asdf',
     }
     with self.assertRaises(ParamValidationError):
         handlers.validate_bucket_name(params)
Beispiel #3
0
 def test_bucket_too_long_raises_exception(self):
     params = {
         'Bucket': 'a' * 300,
         'Key': 'foo',
         'Body': b'asdf',
     }
     with self.assertRaises(ParamValidationError):
         handlers.validate_bucket_name(params)
Beispiel #4
0
 def test_invalid_char_in_bucket_raises_exception(self):
     params = {
         'Bucket': 'bad/bucket/name',
         'Key': 'foo',
         'Body': b'asdf',
     }
     with self.assertRaises(ParamValidationError):
         handlers.validate_bucket_name(params)
Beispiel #5
0
 def test_not_dns_compat_but_still_valid_bucket_name(self):
     params = {
         'Bucket': 'foasdf......bar--baz-a_b_CD10',
         'Key': 'foo',
         'Body': b'asdf',
     }
     self.assertIsNone(handlers.validate_bucket_name(params))
Beispiel #6
0
 def test_not_dns_compat_but_still_valid_bucket_name(self):
     params = {
         'Bucket': 'foasdf......bar--baz-a_b_CD10',
         'Key': 'foo',
         'Body': b'asdf',
     }
     self.assertIsNone(handlers.validate_bucket_name(params))
Beispiel #7
0
 def test_validation_is_noop_if_no_bucket_param_exists(self):
     self.assertIsNone(handlers.validate_bucket_name(params={}))
Beispiel #8
0
 def test_valid_bucket_name_period(self):
     self.assertIsNone(
         handlers.validate_bucket_name({'Bucket': 'my.bucket.name'}))
Beispiel #9
0
 def test_bucket_too_long_raises_exception(self):
     params = {"Bucket": "a" * 300, "Key": "foo", "Body": b"asdf"}
     with self.assertRaises(ParamValidationError):
         handlers.validate_bucket_name(params)
Beispiel #10
0
 def test_valid_bucket_name_period(self):
     self.assertIsNone(
         handlers.validate_bucket_name({'Bucket': 'my.bucket.name'}))
Beispiel #11
0
 def test_valid_bucket_name_period(self):
     self.assertIsNone(handlers.validate_bucket_name({"Bucket": "my.bucket.name"}))
Beispiel #12
0
 def test_valid_bucket_name_underscore(self):
     self.assertIsNone(handlers.validate_bucket_name({"Bucket": "my_bucket_name"}))
Beispiel #13
0
 def test_valid_bucket_name_hyphen(self):
     self.assertIsNone(handlers.validate_bucket_name({"Bucket": "my-bucket-name"}))
Beispiel #14
0
 def test_not_dns_compat_but_still_valid_bucket_name(self):
     params = {"Bucket": "foasdf......bar--baz-a_b_CD10", "Key": "foo", "Body": b"asdf"}
     self.assertIsNone(handlers.validate_bucket_name(params))
Beispiel #15
0
 def test_valid_bucket_name_hyphen(self):
     self.assertIsNone(
         handlers.validate_bucket_name({'Bucket': 'my-bucket-name'}))
Beispiel #16
0
 def test_valid_bucket_name_hyphen(self):
     self.assertIsNone(
         handlers.validate_bucket_name({'Bucket': 'my-bucket-name'}))
Beispiel #17
0
 def test_valid_bucket_name_underscore(self):
     self.assertIsNone(
         handlers.validate_bucket_name({'Bucket': 'my_bucket_name'}))
Beispiel #18
0
 def test_valid_bucket_name_underscore(self):
     self.assertIsNone(
         handlers.validate_bucket_name({'Bucket': 'my_bucket_name'}))
Beispiel #19
0
 def test_validation_is_noop_if_no_bucket_param_exists(self):
     self.assertIsNone(handlers.validate_bucket_name(params={}))
Beispiel #20
0
 def test_invalid_char_in_bucket_raises_exception(self):
     params = {"Bucket": "bad/bucket/name", "Key": "foo", "Body": b"asdf"}
     with self.assertRaises(ParamValidationError):
         handlers.validate_bucket_name(params)