File: test_invalidation.py

package info (click to toggle)
python-boto 2.49.0-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,888 kB
  • sloc: python: 86,396; makefile: 112
file content (23 lines) | stat: -rw-r--r-- 849 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
from tests.compat import unittest

import boto.cloudfront as cf

class CFInvalidationTest(unittest.TestCase):

    cloudfront = True

    def test_wildcard_escape(self):
        """
        Test that wildcards are retained as literals
        See: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#invalidation-specifying-objects-paths
        """
        batch = cf.invalidation.InvalidationBatch()
        self.assertEqual(batch.escape("/*"), "/*")
        self.assertEqual(batch.escape("/foo*"), "/foo*")
        self.assertEqual(batch.escape("/foo/bar/*"), "/foo/bar/*")
        self.assertEqual(batch.escape("/nowildcard"), "/nowildcard")
        self.assertEqual(batch.escape("/other special characters"), "/other%20special%20characters")

if __name__ == '__main__':
    unittest.main()