Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Xbus emitter
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo modules
Xbus emitter
Commits
acf498bc
Commit
acf498bc
authored
7 years ago
by
Houzefa Abbasbhay
Browse files
Options
Downloads
Patches
Plain Diff
Tests
parent
e62406b4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/__init__.py
+3
-0
3 additions, 0 deletions
tests/__init__.py
tests/test_xbus_emitter.py
+51
-0
51 additions, 0 deletions
tests/test_xbus_emitter.py
with
54 additions
and
0 deletions
tests/__init__.py
0 → 100644
+
3
−
0
View file @
acf498bc
# flake8: noqa
from
.
import
test_xbus_emitter
This diff is collapsed.
Click to expand it.
tests/test_xbus_emitter.py
0 → 100644
+
51
−
0
View file @
acf498bc
##############################################################################
#
# 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.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment