Skip to content

Commit 8d36461

Browse files
committed
Merge branch 'maintenance-0.5' into maintenance-0.6
2 parents df9f2ee + 0c1de8f commit 8d36461

File tree

9 files changed

+32
-25
lines changed

9 files changed

+32
-25
lines changed

nirum/datastructures.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,26 @@ def __repr__(self):
5353

5454
class List(collections.Sequence):
5555

56-
def __init__(self, l):
57-
self.l = l
56+
def __init__(self, items):
57+
self.items = items
5858

5959
def __getitem__(self, index):
60-
return self.l[index]
60+
return self.items[index]
6161

6262
def __len__(self):
63-
return len(self.l)
63+
return len(self.items)
6464

6565
def __contains__(self, item):
66-
return item in self.l
66+
return item in self.items
6767

6868
def __iter__(self):
69-
return iter(self.l)
69+
return iter(self.items)
7070

7171
def index(self, item):
72-
return self.l.index(item)
72+
return self.items.index(item)
7373

7474
def count(self, item):
75-
return self.l.count(item)
75+
return self.items.count(item)
7676

7777

7878
map_type = Map

nirum/service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import typing
66

77
from .constructs import NameDict
8-
from .exc import (InvalidNirumServiceMethodTypeError,
9-
InvalidNirumServiceMethodNameError)
8+
from .exc import (InvalidNirumServiceMethodNameError,
9+
InvalidNirumServiceMethodTypeError)
1010

1111
__all__ = 'Service',
1212

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_version():
4242
'pytest >= 3.1.2, < 4.0.0',
4343
'pytest-flake8 >= 0.8.1, < 1.0.0',
4444
'flake8-import-order >= 0.12, < 1.0',
45-
'flake8-import-order-spoqa >= 1.0.0, < 2.0.0',
45+
'flake8-import-order-spoqa >= 1.0.1, < 2.0.0',
4646
]
4747
docs_require = [
4848
'Sphinx',

tests/deserialize_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
import typing
66
import uuid
77

8-
from pytest import raises, mark
8+
from pytest import mark, raises
99
from six import PY3, text_type
1010

1111
from nirum._compat import utc
12-
from nirum.deserialize import (deserialize_unboxed_type, deserialize_meta,
12+
from nirum.deserialize import (deserialize_meta,
13+
deserialize_optional,
14+
deserialize_primitive,
15+
deserialize_record_type,
1316
deserialize_tuple_type,
14-
deserialize_record_type, deserialize_union_type,
15-
deserialize_optional, deserialize_primitive)
17+
deserialize_unboxed_type,
18+
deserialize_union_type)
1619
from nirum.serialize import serialize_record_type
1720

1821

tests/rpc_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import json
22

33
from fixture import BadRequest, MusicService, Unknown
4-
from pytest import fixture, raises, mark
4+
from pytest import fixture, mark, raises
55
from six import text_type
6-
from werkzeug.test import Client as TestClient
6+
from werkzeug.test import Client as WTestClient
77
from werkzeug.wrappers import Response
88

99
from nirum.deserialize import deserialize_meta
@@ -59,7 +59,7 @@ def fx_music_wsgi():
5959

6060
@fixture
6161
def fx_test_client(fx_music_wsgi):
62-
return TestClient(fx_music_wsgi, Response)
62+
return WTestClient(fx_music_wsgi, Response)
6363

6464

6565
def test_wsgi_app_ping(fx_music_wsgi, fx_test_client):
@@ -247,7 +247,7 @@ class ExtendedWsgiApp(WsgiApp):
247247
def make_response(self, status_code, headers, content):
248248
return (status_code, headers, content, None)[:arity]
249249
wsgi_app = ExtendedWsgiApp(MusicServiceImpl())
250-
client = TestClient(wsgi_app, Response)
250+
client = WTestClient(wsgi_app, Response)
251251
with raises(TypeError) as e:
252252
client.post('/?method=get_music_by_artist_name',
253253
data=json.dumps({'artist_name': u'damien rice'}))

tests/serialize_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
from nirum._compat import utc
99
from nirum.datastructures import List
10-
from nirum.serialize import (serialize_unboxed_type, serialize_record_type,
11-
serialize_meta, serialize_union_type)
10+
from nirum.serialize import (serialize_meta, serialize_record_type,
11+
serialize_unboxed_type, serialize_union_type)
1212

1313

1414
def test_serialize_unboxed_type(fx_offset, fx_token_type):

tests/service_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from fixture import MusicService
22
from pytest import mark, raises
33

4-
from nirum.exc import (InvalidNirumServiceMethodTypeError,
5-
InvalidNirumServiceMethodNameError)
4+
from nirum.exc import (InvalidNirumServiceMethodNameError,
5+
InvalidNirumServiceMethodTypeError)
66

77

88
class MusicServiceNameErrorImpl(MusicService):

tests/validate_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from six import text_type
66

77
from nirum.datastructures import List
8-
from nirum.validate import (validate_unboxed_type, validate_record_type,
9-
validate_union_type, validate_type)
8+
from nirum.validate import (validate_record_type, validate_type,
9+
validate_unboxed_type, validate_union_type)
1010

1111

1212
def test_validate_unboxed_type():

tox.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ envlist = buildfixture,{py27,py34,py35,py36}-{typing351,typing352},docs
33

44
[testenv]
55
deps =
6+
; FIXME: the following command should be removed when
7+
; https://github.com/tholo/pytest-flake8/pull/35 is merged:
8+
git+git://github.com/jezdez/[email protected]
9+
610
-e.[tests]
711
typing351: typing<3.5.2
812
typing352: typing>=3.5.2

0 commit comments

Comments
 (0)