Revision d58d0327 snf-cyclades-app/synnefo/api/tests/subnets.py

b/snf-cyclades-app/synnefo/api/tests/subnets.py
143 143
                             json.dumps(request), "json")
144 144
        self.assertBadRequest(response)
145 145

  
146
    def test_create_subnet_with_malformed_network_id(self):
147
        """Test create a subnet with an invalid network ID"""
148
        test_net = mf.NetworkFactory()
149
        request = {
150
            'subnet': {
151
                'network_id': 'error',
152
                'cidr': '192.168.42.0/24',
153
                'ip_version': 4}
154
        }
155
        response = self.post(SUBNETS_URL, test_net.userid,
156
                             json.dumps(request), "json")
157
        self.assertBadRequest(response)
158

  
146 159
    def test_create_subnet_success_ipv6(self):
147 160
        """Test create an IPv6 subnet successfully"""
148 161
        test_net = mf.NetworkFactory()

Also available in: Unified diff