Exemplo n.º 1
0
 def setUp(self):
     super(TestReceiverCreate, self).setUp()
     self.cmd = osc_receiver.CreateReceiver(self.app, None)
     self.mock_client.create_receiver = mock.Mock(
         return_value=sdk_receiver.Receiver(None, self.response))
     self.mock_client.get_receiver = mock.Mock(
         return_value=sdk_receiver.Receiver(None, self.response))
Exemplo n.º 2
0
 def test_basic(self):
     sot = receiver.Receiver()
     self.assertEqual('receiver', sot.resource_key)
     self.assertEqual('receivers', sot.resources_key)
     self.assertEqual('/receivers', sot.base_path)
     self.assertEqual('clustering', sot.service.service_type)
     self.assertTrue(sot.allow_create)
     self.assertTrue(sot.allow_get)
     self.assertTrue(sot.allow_update)
     self.assertTrue(sot.allow_delete)
     self.assertTrue(sot.allow_list)
Exemplo n.º 3
0
 def test_instantiate(self):
     sot = receiver.Receiver(**FAKE)
     self.assertEqual(FAKE['id'], sot.id)
     self.assertEqual(FAKE['name'], sot.name)
     self.assertEqual(FAKE['type'], sot.type)
     self.assertEqual(FAKE['cluster_id'], sot.cluster_id)
     self.assertEqual(FAKE['action'], sot.action)
     self.assertEqual(FAKE['params'], sot.params)
     self.assertEqual(FAKE['created_at'], sot.created_at)
     self.assertEqual(FAKE['updated_at'], sot.updated_at)
     self.assertEqual(FAKE['user'], sot.user_id)
     self.assertEqual(FAKE['project'], sot.project_id)
     self.assertEqual(FAKE['domain'], sot.domain_id)
     self.assertEqual(FAKE['channel'], sot.channel)
Exemplo n.º 4
0
 def setUp(self):
     super(TestReceiverList, self).setUp()
     self.cmd = osc_receiver.ListReceiver(self.app, None)
     self.mock_client.receivers = mock.Mock(
         return_value=sdk_receiver.Receiver(None, {}))
Exemplo n.º 5
0
 def setUp(self):
     super(TestReceiverShow, self).setUp()
     self.cmd = osc_receiver.ShowReceiver(self.app, None)
     self.mock_client.get_receiver = mock.Mock(
         return_value=sdk_receiver.Receiver(None, self.get_response))