def test_datasource_poll(self): neutron = self.neutronv2 neutron.stop() neutron._translate_ports({'ports': []}) self.assertEqual(len(neutron.state['ports']), 0) neutron.start() f = lambda: len(neutron.state['ports']) helper.retry_check_function_return_value_not_eq(f, 0)
def test_datasource_request_refresh(self): # Remember that neutron does not poll automatically here, which # is why this test actually testing request_refresh neutron = self.cage.service_object('neutron') LOG.info("neutron.state: %s", neutron.state) self.assertEqual(len(neutron.state['ports']), 0) # TODO(thinrichs): Seems we can't test the datasource API at all. # api['datasource'].request_refresh_action( # {}, context, helper.FakeRequest({})) neutron.request_refresh() f = lambda: len(neutron.state['ports']) helper.retry_check_function_return_value_not_eq(f, 0)