Skip to content
Snippets Groups Projects
Commit acf498bc authored by Houzefa Abbasbhay's avatar Houzefa Abbasbhay :slight_smile:
Browse files

Tests

parent e62406b4
No related branches found
No related tags found
No related merge requests found
# flake8: noqa
from . import test_xbus_emitter
##############################################################################
#
# Xbus emitter for Odoo
# Copyright (C) 2015 XCG Consulting <http://odoo.consulting>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import odoo
from .util.odoo_tests import TestBase
from .util.uuidgen import genUuid
@odoo.tests.common.at_install(False)
@odoo.tests.common.post_install(True)
class Test(TestBase):
def test_0000_create_xbus_emitter_job(self):
"""Basic job creation test using public methods provided by this
module.
"""
emitter, = self.createAndTest(
'xbus.emitter',
[{'name': genUuid()}],
)
EVENT_TYPE = genUuid()
DATA = {'foo': 'bar'}
job = emitter.send_items(EVENT_TYPE, DATA)
self.assertTrue(job)
self.assertEqual(job.event_type, EVENT_TYPE)
self.assertFalse(job.log) # Not processed yet.
self.assertEqual(job.items, '{"foo": "bar"}') # JSON-ified
self.assertEqual(job.state, 'to_send')
# TODO Check whether a "NOTIFY" postgresql command has been sent.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment