Revision f261896d snf-cyclades-app/synnefo/neutron/tests/api.py

b/snf-cyclades-app/synnefo/neutron/tests/api.py
73 73
        response = self.put(url,params=json.dumps(request),user=test_net.userid)
74 74
        self.assertEqual(response.status_code, 400)
75 75

  
76

  
76 77
class SubnetTest(BaseAPITest):
77 78
    def test_list_subnets(self):
78 79
        '''Test Subnet list'''
......
95 96
        response = self.get(url)
96 97
        self.assertItemNotFound(response)
97 98

  
98
    def test_subnet_delete_not_in_use(self):
99
    def test_subnet_delete_not_found(self):
100
        '''Test delete a subnet that doesn't exist'''
101
        url = join_urls(SUBNETS_URL, '52')
102
        response = self.get(url)
103
        self.assertItemNotFound(response)
104

  
105
    def test_subnet_delete(self):
99 106
        '''Test delete a subnet that's not in use'''
100 107
        url = join_urls(SUBNETS_URL, '42')
101 108
        response = self.get(url)
102 109
        self.assertItemNotFound(response)
110

  
111
    def test_create_subnet_with_malformed_ipversion(self):
112
        '''Create a subnet with a malformed ip_version type'''
113
        # PEP8 for {{}}?
114
        request = {'subnet': {'network_id':
115
                              'ed2e3c10-2e43-4297-9006-2863a2d1abbc',
116
                              'cidr': '10.0.3.0/24',
117
                              'ip_version': 8}}
118

  
119
        response = self.post(SUBNETS_URL, "user9", json.dumps(request), "json")
120
        self.assertBadRequest(response)

Also available in: Unified diff