Skip to content

Commit

Permalink
Merge pull request #1615 from hyperledger/style/stable-black
Browse files Browse the repository at this point in the history
style: format with stable black release
  • Loading branch information
andrewwhitehead authored Feb 5, 2022
2 parents cd5e63c + 8dcd715 commit 343679a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 27 deletions.
32 changes: 12 additions & 20 deletions aries_cloudagent/admin/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,10 @@ def send_fn(self) -> Coroutine:
async def ready_middleware(request: web.BaseRequest, handler: Coroutine):
"""Only continue if application is ready to take work."""

if (
str(request.rel_url).rstrip("/")
in (
"/status/live",
"/status/ready",
)
or request.app._state.get("ready")
):
if str(request.rel_url).rstrip("/") in (
"/status/live",
"/status/ready",
) or request.app._state.get("ready"):
try:
return await handler(request)
except (LedgerConfigError, LedgerTransactionError) as e:
Expand Down Expand Up @@ -267,18 +263,14 @@ async def make_application(self) -> web.Application:
assert self.admin_insecure_mode ^ bool(self.admin_api_key)

def is_unprotected_path(path: str):
return (
path
in [
"/api/doc",
"/api/docs/swagger.json",
"/favicon.ico",
"/ws", # ws handler checks authentication
"/status/live",
"/status/ready",
]
or path.startswith("/static/swagger/")
)
return path in [
"/api/doc",
"/api/docs/swagger.json",
"/favicon.ico",
"/ws", # ws handler checks authentication
"/status/live",
"/status/ready",
] or path.startswith("/static/swagger/")

# If admin_api_key is None, then admin_insecure_mode must be set so
# we can safely enable the admin server with no security
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/messaging/jsonld/tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ async def test_sign_credential(self):
),
"degree": {
"type": "BachelorDegree",
"name": u"Bachelor of Encyclopædic Arts",
"name": "Bachelor of Encyclopædic Arts",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/messaging/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


LOGGER = logging.getLogger(__name__)
I32_BOUND = 2 ** 31
I32_BOUND = 2**31


def datetime_to_str(dt: Union[str, datetime]) -> str:
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/utils/tests/test_outofband.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TestOutOfBand(TestCase):

def test_serialize_oob(self):
invi = InvitationMessage(
comment="my sister", label=u"ma sœur", services=[TestOutOfBand.test_did]
comment="my sister", label="ma sœur", services=[TestOutOfBand.test_did]
)

result = test_module.serialize_outofband(
Expand Down
4 changes: 2 additions & 2 deletions demo/features/steps/0160-connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


@given("{n} agents")
@given(u"we have {n} agents")
@given("we have {n} agents")
def step_impl(context, n):
"""Startup 'n' agents based on the options provided in the context table parameters."""

Expand Down Expand Up @@ -112,7 +112,7 @@ def step_impl(context, agent_name):
@given('"{sender}" and "{receiver}" have an existing connection')
def step_impl(context, sender, receiver):
context.execute_steps(
u'''
'''
When "'''
+ sender
+ '''" generates a connection invitation
Expand Down
4 changes: 2 additions & 2 deletions demo/features/steps/0453-issue-credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def step_impl(context, holder):
)
def step_impl(context, holder, schema_name, credential_data, issuer):
context.execute_steps(
u'''
'''
Given "'''
+ issuer
+ """" is ready to issue a json-ld credential for """
Expand Down Expand Up @@ -255,7 +255,7 @@ def step_impl(context, holder, schema_name, credential_data, issuer):
)
def step_impl(context, holder, schema_name, credential_data, issuer):
context.execute_steps(
u'''
'''
Given "'''
+ issuer
+ """" is ready to issue a credential for """
Expand Down

0 comments on commit 343679a

Please sign in to comment.