def test_credentials(self): """ Test a connection using a credentials.""" creds = {} for s in self.vcap_services['streaming-analytics']: if s['name'] == self.service_name: creds = s['credentials'] sasc = StreamingAnalyticsConnection.of_definition(creds) instances = sasc.get_instances() self.assertEqual(1, len(instances))
def test_service_def(self): """ Test a connection using a service definition.""" creds = {} for s in self.vcap_services['streaming-analytics']: if s['name'] == self.service_name: creds = s['credentials'] service = {'type':'streaming-analytics', 'name':self.service_name} service['credentials'] = creds sasc = StreamingAnalyticsConnection.of_definition(service) instances = sasc.get_instances() self.assertEqual(1, len(instances))
def test_service_def(self): """ Test a connection using a service definition.""" creds = {} for s in self.vcap_services['streaming-analytics']: if s['name'] == self.service_name: creds = s['credentials'] service = {'type': 'streaming-analytics', 'name': self.service_name} service['credentials'] = creds sasc = StreamingAnalyticsConnection.of_definition(service) instances = sasc.get_instances() self.assertEqual(1, len(instances))