Skip to content

Commit b743394

Browse files
committed
Rename api to helpers
1 parent b27cc94 commit b743394

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

oca/api.py renamed to oca/helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def foreach(container=None):
1818
1919
.. code-block:: python
2020
21-
@api.foreach(list)
21+
@helpers.foreach(list)
2222
def method(self):
2323
return self.id
2424
@@ -38,12 +38,12 @@ def method(self):
3838
3939
.. code-block:: python
4040
41-
@api.foreach()
41+
@helpers.foreach()
4242
def method(self):
4343
# Raises ValueError
4444
return 1+2
4545
46-
@api.foreach()
46+
@helpers.foreach()
4747
def method(self):
4848
# No error raised
4949
self.math = 1+2
@@ -75,7 +75,7 @@ def loop(method, self, *args, **kwargs):
7575
return container(results)
7676

7777
wrapper = decorator(loop, method)
78-
wrapper._api = 'foreach'
78+
wrapper._helpers = 'foreach'
7979
return wrapper
8080

8181
return _foreach

oca/tests/test_api_foreach.py renamed to oca/tests/test_helpers_foreach.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@
44

55
import unittest
66

7-
from .. import api
7+
from .. import helpers
88
from .common import TestRecordset
99

1010

1111
class ForeachRecordset(TestRecordset):
1212

13-
@api.foreach(list)
13+
@helpers.foreach(list)
1414
def decorated_method_list(self):
1515
return self
1616

17-
@api.foreach()
17+
@helpers.foreach()
1818
def decorated_method_none(self):
1919
return
2020

21-
@api.foreach()
21+
@helpers.foreach()
2222
def decorated_method_none_return(self):
2323
return self
2424

2525

26-
class TestApiForeach(unittest.TestCase):
26+
class TestHelpersForeach(unittest.TestCase):
2727

2828
def setUp(self):
2929
self.record = ForeachRecordset()
30-
super(TestApiForeach, self).setUp()
30+
super(TestHelpersForeach, self).setUp()
3131

3232
def test_foreach_list(self):
3333
""" It should iterate and return list of method results. """

0 commit comments

Comments
 (0)