Skip to content

Commit

Permalink
[ADD] connector_carepoint: Add test coverage
Browse files Browse the repository at this point in the history
* Add Binder tests
* Add Mapper tests
* Add BaseExporter tests
* Add CarepointExporter tests
* Add related_action tests
* Add consumer tests
  • Loading branch information
lasley committed Aug 5, 2016
1 parent 9e5dd0a commit 21a816c
Show file tree
Hide file tree
Showing 64 changed files with 1,136 additions and 116 deletions.
2 changes: 1 addition & 1 deletion connector_carepoint/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/backend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import openerp.addons.connector.backend as backend
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/connector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields
Expand Down
28 changes: 14 additions & 14 deletions connector_carepoint/consumer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp.addons.connector.connector import Binder
# from openerp.addons.connector.connector import Binder
from .unit.export_synchronizer import (export_record,
)
from .unit.delete_synchronizer import export_delete_record
from .connector import get_environment
# from .unit.delete_synchronizer import export_delete_record
# from .connector import get_environment
# from openerp.addons.connector.event import (on_record_write,
# on_record_create,
# on_record_unlink
Expand Down Expand Up @@ -58,13 +58,13 @@ def delay_export_all_bindings(session, model_name, record_id, vals):
# 'carepoint.carepoint.address',
# 'carepoint.carepoint.address.patient',
# ])
def delay_unlink(session, model_name, record_id):
""" Delay a job which delete a record on Carepoint.
Called on binding records."""
record = session.env[model_name].browse(record_id)
env = get_environment(session, model_name, record.backend_id.id)
binder = env.get_connector_unit(Binder)
carepoint_id = binder.to_backend(record_id, wrap=False)
if carepoint_id:
export_delete_record.delay(session, model_name,
record.backend_id.id, carepoint_id)
# def delay_unlink(session, model_name, record_id):
# """ Delay a job which delete a record on Carepoint.
# Called on binding records."""
# record = session.env[model_name].browse(record_id)
# env = get_environment(session, model_name, record.backend_id.id)
# binder = env.get_connector_unit(Binder)
# carepoint_id = binder.to_backend(record_id, wrap=False)
# if carepoint_id:
# export_delete_record.delay(session, model_name,
# record.backend_id.id, carepoint_id)
2 changes: 1 addition & 1 deletion connector_carepoint/data/medical_units.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

#
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

# Backend
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/account.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/account_invoice_line.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/address.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/address_patient.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/address_pharmacy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/address_physician.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/carepoint_backend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/carepoint_person.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/carepoint_state.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_form.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_gcn.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_gcn_seq.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_img.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_img_date.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_img_id.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_img_mfg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_lbl_rid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_ndc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_ndc_cs_ext.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_pem_moe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_pem_mogc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_route.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/fdb_unit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/medical_medicament.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/medical_medicament_attribute.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/medical_patient.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/medical_pharmacy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/medical_physician.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/medical_prescription_order.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/procurement_order.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/res_users.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/sale_order_line_non_rx.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/related_action.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

"""
Expand Down
11 changes: 10 additions & 1 deletion connector_carepoint/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# -*- coding: utf-8 -*-
# © 2015 LasLabs Inc.
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import test_carepoint_backend
from . import test_backend_adapter
from . import test_binder
from . import test_mapper
from . import test_base_exporter
from . import test_carepoint_exporter
from . import test_related_action
from . import test_consumer


from . import models
Loading

0 comments on commit 21a816c

Please sign in to comment.