diff --git a/examples/rpc-client.py b/examples/rpc-client.py index c594299..8dcd5a1 100755 --- a/examples/rpc-client.py +++ b/examples/rpc-client.py @@ -373,7 +373,7 @@ def main(argv=None): # Create the RPC caller method = {'method': method_info[0], - 'args': dict([(method_info[i], method_info[i+1]) + 'args': dict([(method_info[i], method_info[i + 1]) for i in range(1, len(method_info), 2)])} my_caller = my_connection.create_caller(method, "my-source-address", diff --git a/pyngus/connection.py b/pyngus/connection.py index 6e4b280..5f34912 100644 --- a/pyngus/connection.py +++ b/pyngus/connection.py @@ -424,8 +424,6 @@ class Connection(Endpoint): self._pn_sasl = None self._pn_ssl = None - _REMOTE_REQ = (proton.Endpoint.LOCAL_UNINIT - | proton.Endpoint.REMOTE_ACTIVE) _CLOSED = (proton.Endpoint.LOCAL_CLOSED | proton.Endpoint.REMOTE_CLOSED) _ACTIVE = (proton.Endpoint.LOCAL_ACTIVE | proton.Endpoint.REMOTE_ACTIVE) diff --git a/pyngus/link.py b/pyngus/link.py index 1b50a9d..74c7def 100644 --- a/pyngus/link.py +++ b/pyngus/link.py @@ -188,15 +188,15 @@ class _Link(Endpoint): def active(self): state = self._pn_link.state return (not self._failed and - state == (proton.Endpoint.LOCAL_ACTIVE - | proton.Endpoint.REMOTE_ACTIVE)) + state == (proton.Endpoint.LOCAL_ACTIVE | + proton.Endpoint.REMOTE_ACTIVE)) @property def closed(self): state = self._pn_link.state return (self._failed or - state == (proton.Endpoint.LOCAL_CLOSED - | proton.Endpoint.REMOTE_CLOSED)) + state == (proton.Endpoint.LOCAL_CLOSED | + proton.Endpoint.REMOTE_CLOSED)) def reject(self, pn_condition): self._rejected = True # prevent 'active' callback! diff --git a/tests/unit_tests/connection.py b/tests/unit_tests/connection.py index fbe4ddc..523948b 100644 --- a/tests/unit_tests/connection.py +++ b/tests/unit_tests/connection.py @@ -201,8 +201,8 @@ class APITest(common.Test): assert c1_events.remote_closed_ct == 0 c2.close() common.process_connections(c1, c2) - assert (c1_events.remote_closed_ct == 1 - and c2_events.remote_closed_ct == 0) + assert (c1_events.remote_closed_ct == 1 and + c2_events.remote_closed_ct == 0) assert c1_events.closed_ct == 0 and c2_events.closed_ct == 0 assert not c1.active and not c2.active c1.close() diff --git a/tox.ini b/tox.ini index 8a3fed3..ad0f420 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ deps = -r{toxinidir}/test-requirements.txt commands = {toxinidir}/tests/test-runner [testenv:pep8] -commands = flake8 pyngus examples tests +commands = flake8 --ignore E402 pyngus examples tests flake8 --ignore F401 setup.py [flake8]