예제 #1
0
    def test_endpoint_delete(self, mock):
        '''
        Test if it delete an endpoint for an Openstack service
        '''
        ret = {'Error': 'Could not find any endpoints for the service'}
        self.assertDictEqual(keystone.endpoint_delete('nova'), ret)

        with patch.object(keystone, 'endpoint_get',
                          MagicMock(side_effect=[{'id': '117'}, None])):
            self.assertTrue(keystone.endpoint_delete('iptables'))
예제 #2
0
    def test_endpoint_delete(self, mock):
        '''
        Test if it delete an endpoint for an Openstack service
        '''
        ret = {'Error': 'Could not find any endpoints for the service'}
        self.assertDictEqual(keystone.endpoint_delete('nova'), ret)

        with patch.object(keystone, 'endpoint_get',
                          MagicMock(side_effect=[{'id': '117'}, None])):
            self.assertTrue(keystone.endpoint_delete('iptables'))
예제 #3
0
    def test_endpoint_delete(self):
        """
        Test if it delete an endpoint for an Openstack service
        """
        ret = {"Error": "Could not find any endpoints for the service"}
        self.assertDictEqual(keystone.endpoint_delete("nova", "RegionOne"),
                             ret)

        with patch.object(keystone, "endpoint_get",
                          MagicMock(side_effect=[{
                              "id": "117"
                          }, None])):
            self.assertTrue(keystone.endpoint_delete("iptables", "RegionOne"))