예제 #1
0
    def test_service_get(self, mock):
        '''
        Test if it return a list of available services (keystone services-list)
        '''
        MockServices.flag = 0
        self.assertDictEqual(keystone.service_get(),
                             {'Error': 'Unable to resolve service id'})

        MockServices.flag = 2
        self.assertDictEqual(keystone.service_get(service_id='c965'),
                             {'iptables': {'description': 'description',
                                           'id': 'c965',
                                           'name': 'iptables',
                                           'type': 'type'}})
예제 #2
0
    def test_service_get(self, mock):
        '''
        Test if it return a list of available services (keystone services-list)
        '''
        MockServices.flag = 0
        self.assertDictEqual(keystone.service_get(),
                             {'Error': 'Unable to resolve service id'})

        MockServices.flag = 2
        self.assertDictEqual(keystone.service_get(service_id='c965'),
                             {'iptables': {'description': 'description',
                                           'id': 'c965',
                                           'name': 'iptables',
                                           'type': 'type'}})
예제 #3
0
    def test_service_get(self):
        """
        Test if it return a list of available services (keystone services-list)
        """
        MockServices.flag = 0
        self.assertDictEqual(keystone.service_get(),
                             {"Error": "Unable to resolve service id"})

        MockServices.flag = 2
        self.assertDictEqual(
            keystone.service_get(service_id="c965"),
            {
                "iptables": {
                    "description": "description",
                    "id": "c965",
                    "name": "iptables",
                    "type": "type",
                }
            },
        )