Skip to content

Commit

Permalink
Test and flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
katyukha committed Feb 1, 2017
1 parent 5f53c0e commit a2decdb
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 51 deletions.
4 changes: 2 additions & 2 deletions openerp_proxy/connection/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from odoo_rpc_client.connection import (xmlrpc, # noqa
jsonrpc,
from odoo_rpc_client.connection import (xmlrpc, # noqa
jsonrpc, # noqa
connection) # noqa
from odoo_rpc_client.connection.connection import (ConnectorBase, # noqa
get_connector, # noqa
Expand Down
2 changes: 1 addition & 1 deletion openerp_proxy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@
... 'assigned'
"""

from odoo_rpc_client.client import Client
from odoo_rpc_client.client import Client # noqa
12 changes: 6 additions & 6 deletions openerp_proxy/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from odoo_rpc_client.exceptions import (Error,
ConnectorError,
ClientException,
ReportError,
LoginException,
ObjectException)
from odoo_rpc_client.exceptions import (Error, # noqa
ConnectorError, # noqa
ClientException, # noqa
ReportError, # noqa
LoginException, # noqa
ObjectException) # noqa
6 changes: 3 additions & 3 deletions openerp_proxy/orm/cache.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from odoo_rpc_client.orm.cache import (empty_cache,
Cache,
ObjectCache)
from odoo_rpc_client.orm.cache import (empty_cache, # noqa
Cache, # noqa
ObjectCache) # noqa
3 changes: 2 additions & 1 deletion openerp_proxy/orm/object.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from odoo_rpc_client.orm.object import (Object, get_object)
from odoo_rpc_client.orm.object import (Object, # noqa
get_object) # noqa
12 changes: 6 additions & 6 deletions openerp_proxy/orm/record.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
""" This module contains classes and logic to handle operations on records
"""
from odoo_rpc_client.orm.record import (Record,
RecordList,
ObjectRecords,
get_record,
get_record_list)
from odoo_rpc_client.orm.record import (Record, # noqa
RecordList, # noqa
ObjectRecords, # noqa
get_record, # noqa
get_record_list) # noqa


# For backward compatability
RecordRelations = Record
RecordRelations = Record # noqa
2 changes: 1 addition & 1 deletion openerp_proxy/orm/service.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from odoo_rpc_client.orm.service import Service
from odoo_rpc_client.orm.service import Service # noqa
4 changes: 2 additions & 2 deletions openerp_proxy/plugin.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from odoo_rpc_client.plugin import (Plugin,
PluginManager)
from odoo_rpc_client.plugin import (Plugin, # noqa
PluginManager) # noqa
4 changes: 2 additions & 2 deletions openerp_proxy/plugins/external_ids.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
from odoo_rpc_client.plugins.external_ids import (ExternalIDS,
Record__XMLIDS)
from odoo_rpc_client.plugins.external_ids import (ExternalIDS, # noqa
Record__XMLIDS) # noqa
4 changes: 2 additions & 2 deletions openerp_proxy/plugins/module_utils.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from odoo_rpc_client.plugins.module_utils import (ModuleObject,
ModuleUtils)
from odoo_rpc_client.plugins.module_utils import (ModuleObject, # noqa
ModuleUtils) # noqa
3 changes: 2 additions & 1 deletion openerp_proxy/service/db.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from odoo_rpc_client.service.db import DBService
from odoo_rpc_client.service.db import (DBService, # noqa
to_dbname) # noqa
2 changes: 1 addition & 1 deletion openerp_proxy/service/object.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from odoo_rpc_client.service.object import ObjectService
from odoo_rpc_client.service.object import ObjectService # noqa
8 changes: 4 additions & 4 deletions openerp_proxy/service/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
just use *report.save(path)* method)
"""

from odoo_rpc_client.service.report import (ReportError,
ReportResult,
Report,
ReportService)
from odoo_rpc_client.service.report import (ReportError, # noqa
ReportResult, # noqa
Report, # noqa
ReportService) # noqa
6 changes: 3 additions & 3 deletions openerp_proxy/service/service.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from odoo_rpc_client.service.service import (get_service_class,
ServiceBase,
ServiceManager)
from odoo_rpc_client.service.service import (get_service_class, # noqa
ServiceBase, # noqa
ServiceManager) # noqa
8 changes: 4 additions & 4 deletions openerp_proxy/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ def test_160_plugins(self):
# Check plugin representation
self.assertEqual(
str(self.client.plugins),
"openerp_proxy.plugin.PluginManager [%d]" % len(
"odoo_rpc_client.plugin.PluginManager [%d]" % len(
self.client.plugins))
self.assertEqual(
repr(self.client.plugins),
"<openerp_proxy.plugin.PluginManager [%d]>" % len(
"<odoo_rpc_client.plugin.PluginManager [%d]>" % len(
self.client.plugins))
self.assertEqual(
str(self.client.plugins.Test),
"openerp_proxy.plugin.Plugin:Test")
"odoo_rpc_client.plugin.Plugin:Test")
self.assertEqual(
repr(self.client.plugins.Test),
"<openerp_proxy.plugin.Plugin:Test>")
"<odoo_rpc_client.plugin.Plugin:Test>")

def test_162_plugins_wrong_name(self):
self.assertNotIn(
Expand Down
7 changes: 5 additions & 2 deletions openerp_proxy/tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ def test_05_reconnect(self):
self.assertEqual(old_uid, cl.uid)

def test_06_get_connector_names(self):
self.assertItemsEqual(get_connector_names(),
['json-rpc', 'json-rpcs', 'xml-rpc', 'xml-rpcs'])
names = get_connector_names()
self.assertIn('json-rpc', names)
self.assertIn('json-rpcs', names)
self.assertIn('xml-rpc', names)
self.assertIn('xml-rpcs', names)

def test_10_call_unexistint_method(self):
cl = self.client.login(self.env.dbname,
Expand Down
18 changes: 8 additions & 10 deletions openerp_proxy/utils.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# -*- encoding: utf-8 -*-
import os
import six
import json
import functools

from odoo_rpc_client.utils import (normalizeSField,
wpartial,
preprocess_args,
stdcall,
UConverter,
ustr,
DirMixIn,
AttrDict)
from odoo_rpc_client.utils import (normalizeSField, # noqa
wpartial, # noqa
preprocess_args, # noqa
stdcall, # noqa
UConverter, # noqa
ustr, # noqa
DirMixIn, # noqa
AttrDict) # noqa

__all__ = ('ustr',
'AttrDict',
Expand Down

0 comments on commit a2decdb

Please sign in to comment.