def test_no_events(self):
     self.set_field_return_value( \
         '<?xml version="1.0" encoding="ISO-8859-1"?>' \
         '<EventChannel xmlns="urn:schemas-cosylab-com:EventChannel:1.0"' \
         ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' \
         ' IntegrationLogs="true">' \
         '</EventChannel>')
     self.assertEqual({}, CDBP.getEventHandlerTimeoutDict('Key'))
 def test_reject_true(self):
     self.set_element_return_value([{"MaxQueueLength":"0",
                                     "MaxConsumers":"0",
                                     "MaxSuppliers":"0",
                                     "RejectNewEvents":"true"}])
     self.set_field_return_value(True)
     self.assertEqual(4,
                         len(CDBP.get_channel_admin_props('Key')))
 def test_qofs_start_true_stop_true(self):
     self.set_element_return_value([{"DiscardPolicy":"AnyOrder",
                                     "EventReliability":"BestEffort",
                                     "ConnectionReliability":"BestEffort",
                                     "Priority":"0",
                                     "Timeout":"0",
                                     "OrderPolicy":"AnyOrder",
                                     "StartTimeSupported":"true",
                                     "StopTimeSupported":"true",
                                     "MaxEventsPerConsumer":"0"}])
     self.set_field_return_value(True)
     self.assertEqual(5,
                         len(CDBP.get_channel_qofs_props('Key')))
 def test_channel_false(self):
     self.set_element_return_value([{"IntegrationLogs":"false"}])
     self.set_field_return_value(True)
     self.assertEqual(0, CDBP.get_integration_logs('Key'))
     CDBP.INTEGRATION_LOGS = {}
 def test_no_channel(self):
     self.set_field_exception(Exception)
     self.assertEqual(0, CDBP.get_integration_logs('Key'))
 def test_log_exists(self):
     CDBP.INTEGRATION_LOGS = { 'Key':True }
     self.assertEqual(True, CDBP.get_integration_logs('Key'))
     CDBP.INTEGRATION_LOGS = {}
 def test_exception_handling(self):
     self.set_field_exception(Exception)
     self.assertEqual(0, CDBP.cdb_channel_config_exists('Channel'))
 def test_ok(self):
     self.set_field_return_value(['Stuff'])
     self.assertEqual(1, CDBP.cdb_channel_config_exists('Channel'))
 def test_exception_handling(self):
     self.set_element_exception(Exception)
     self.assertEqual([], CDBP.get_notification_service_mapping('Channel'))
 def test_ok(self):
     self.set_element_return_value(['Stuff'])
     self.assertEqual(['Stuff'],
                      CDBP.get_notification_service_mapping('Channel'))
 def test_no_channel(self):
     self.set_field_exception(Exception)
     self.assertEqual({}, CDBP.getEventHandlerTimeoutDict('Key'))