~ubuntu-branches/ubuntu/oneiric/txaws/oneiric-201109300905

« back to all changes in this revision

Viewing changes to txaws/s3/tests/test_client.py

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-09-15 13:13:16 UTC
  • Revision ID: package-import@ubuntu.com-20110915131316-3bdz2ip8x71tmbyr
Tags: 0.2-0ubuntu3
debian/patches/fix-handling-nova-securitygroups.patch,
debian/patches/fix-s3-alternate-port.patch: Fix txaws compatibility
with OpenStack Nova. (LP: #829609 , LP: #824403)

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
    def test_get_path_with_bucket(self):
36
36
        url_context = client.URLContext(self.endpoint, bucket="mystuff")
37
 
        self.assertEquals(url_context.get_path(), "/mystuff")
 
37
        self.assertEquals(url_context.get_path(), "/mystuff/")
38
38
 
39
39
    def test_get_path_with_bucket_and_object(self):
40
40
        url_context = client.URLContext(
62
62
            url_context.get_url(),
63
63
            "http://localhost/mydocs/notes.txt")
64
64
 
 
65
    def test_custom_port_endpoint(self):
 
66
        test_uri='http://0.0.0.0:12345/'
 
67
        endpoint = AWSServiceEndpoint(uri=test_uri)
 
68
        self.assertEquals(endpoint.port, 12345)
 
69
        self.assertEquals(endpoint.scheme, 'http')
 
70
        context = client.URLContext(service_endpoint=endpoint,
 
71
                bucket="foo",
 
72
                object_name="bar")
 
73
        self.assertEquals(context.get_host(), '0.0.0.0')
 
74
        self.assertEquals(context.get_url(), test_uri + 'foo/bar')
 
75
 
 
76
    def test_custom_port_endpoint_https(self):
 
77
        test_uri='https://0.0.0.0:12345/'
 
78
        endpoint = AWSServiceEndpoint(uri=test_uri)
 
79
        self.assertEquals(endpoint.port, 12345)
 
80
        self.assertEquals(endpoint.scheme, 'https')
 
81
        context = client.URLContext(service_endpoint=endpoint,
 
82
                bucket="foo",
 
83
                object_name="bar")
 
84
        self.assertEquals(context.get_host(), '0.0.0.0')
 
85
        self.assertEquals(context.get_url(), test_uri + 'foo/bar')
 
86
 
 
87
 
65
88
URLContextTestCase.skip = s3clientSkip
66
89
 
67
90