def test_action_get_by_name(self): data = parser.simple_parse(shared.sample_action) _create_action(self.ctx) retobj = db_api.action_get_by_name(self.ctx, data['name']) self.assertIsNotNone(retobj) self.assertEqual(data['name'], retobj.name) self.assertEqual(data['target'], retobj.target) self.assertEqual(data['action'], retobj.action) self.assertEqual(data['cause'], retobj.cause) self.assertEqual(data['timeout'], retobj.timeout) self.assertEqual(data['status'], retobj.status) self.assertEqual(data['status_reason'], retobj.status_reason) self.assertEqual(10, retobj.inputs['max_size']) self.assertIsNone(retobj.outputs)
def test_action_get_by_name_invalid(self): retobj = db_api.action_get_by_name(self.ctx, 'fake-name') self.assertIsNone(retobj)