~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to nova/tests/api/openstack/compute/contrib/test_cloudpipe.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-04-04 09:25:14 UTC
  • mfrom: (1.1.52)
  • Revision ID: package-import@ubuntu.com-20120404092514-ry1k7mjzd6plivdk
Tags: 2012.1~rc3-0ubuntu1
* New Upstream release. 
* debian/control: Conflict nova-vncproxy with novnc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
def fake_vpn_instance():
35
35
    return {'id': 7, 'image_ref': FLAGS.vpn_image_id, 'vm_state': 'active',
36
36
            'created_at': utils.parse_strtime('1981-10-20T00:00:00.000000'),
37
 
            'uuid': 7777, 'project_id': 'fake'}
 
37
            'uuid': 7777, 'project_id': 'other'}
38
38
 
39
39
 
40
40
def compute_api_get_all_empty(context):
76
76
                       compute_api_get_all)
77
77
        req = fakes.HTTPRequest.blank('/v2/fake/os-cloudpipe')
78
78
        res_dict = self.controller.index(req)
79
 
        response = {'cloudpipes': [{'project_id': 'fake',
 
79
        response = {'cloudpipes': [{'project_id': 'other',
80
80
                                    'instance_id': 7777,
81
81
                                    'created_at': '1981-10-20T00:00:00Z'}]}
82
82
        self.assertEqual(res_dict, response)
84
84
    def test_cloudpipe_list(self):
85
85
 
86
86
        def network_api_get(context, network_id):
 
87
            self.assertEqual(context.project_id, 'other')
87
88
            return {'vpn_public_address': '127.0.0.1',
88
89
                    'vpn_public_port': 22}
89
90
 
99
100
                       compute_api_get_all)
100
101
        req = fakes.HTTPRequest.blank('/v2/fake/os-cloudpipe')
101
102
        res_dict = self.controller.index(req)
102
 
        response = {'cloudpipes': [{'project_id': 'fake',
 
103
        response = {'cloudpipes': [{'project_id': 'other',
103
104
                                    'internal_ip': '192.168.1.100',
104
105
                                    'public_ip': '127.0.0.1',
105
106
                                    'public_port': 22,