def setUpClass(cls): tests_config.parse_args(coordinator_noop=True) super(ServiceRegistryControllerRBACTestCase, cls).setUpClass() cls.coordinator = coordination.get_coordinator(use_cache=False) # Register mock service in the service registry for testing purposes register_service_in_service_registry(service='mock_service', capabilities={'key1': 'value1', 'name': 'mock_service'}, start_heart=True)
def test_deregister_service_when_service_registry_enabled(self): service = "api" service_setup.register_service_in_service_registry(service, capabilities={ "hostname": "", "pid": "" }) coordinator = coordination.get_coordinator(start_heart=True) members = coordinator.get_members(service.encode("utf-8")) self.assertEqual(len(list(members.get())), 1) service_setup.deregister_service(service) self.assertEqual(len(list(members.get())), 0)
def setUpClass(cls): tests_config.parse_args(coordinator_noop=True) super(ServiceRegistryControllerRBACTestCase, cls).setUpClass() cls.coordinator = coordination.get_coordinator(use_cache=False) # Register mock service in the service registry for testing purposes register_service_in_service_registry(service='mock_service', capabilities={'key1': 'value1', 'name': 'mock_service'}, start_heart=True)
def setUpClass(cls): super(ServiceyRegistryControllerTestCase, cls).setUpClass() tests_config.parse_args(coordinator_noop=True) cls.coordinator = coordination.get_coordinator(use_cache=False) # NOTE: We mock call common_setup to emulate service being registered in the service # registry during bootstrap phase register_service_in_service_registry(service='mock_service', capabilities={'key1': 'value1', 'name': 'mock_service'}, start_heart=True)
def setUpClass(cls): tests_config.parse_args(coordinator_noop=True) super(APIControllersRBACTestCase, cls).setUpClass() cls.coordinator = coordination.get_coordinator(use_cache=False) # Register mock service in the service registry for testing purposes service = six.binary_type(six.text_type('mock_service').encode('ascii')) register_service_in_service_registry(service=service, capabilities={'key1': 'value1', 'name': 'mock_service'}, start_heart=True)
def setUpClass(cls): super(ServiceyRegistryControllerTestCase, cls).setUpClass() tests_config.parse_args(coordinator_noop=True) cls.coordinator = coordination.get_coordinator(use_cache=False) # NOTE: We mock call common_setup to emulate service being registered in the service # registry during bootstrap phase register_service_in_service_registry(service='mock_service', capabilities={'key1': 'value1', 'name': 'mock_service'}, start_heart=True)