Skip to content

Commit

Permalink
PYTHON-4527 ruff-format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneHarvey committed Jun 25, 2024
1 parent f216722 commit c337f39
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: Python Tests
on:
push:
pull_request:
paths:
- bindings/python/*
paths:
- bindings/python/*
- bindings/python/**/*.py

concurrency:
group: python-test-${{ github.ref }}
Expand Down
4 changes: 3 additions & 1 deletion bindings/python/test/performance/perf_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def tearDownModule():

class TestBulkDecryption(unittest.TestCase):
def setUp(self):
opts = MongoCryptOptions({"local": {"key": LOCAL_MASTER_KEY}}, enable_range_v2=True)
opts = MongoCryptOptions(
{"local": {"key": LOCAL_MASTER_KEY}}, enable_range_v2=True
)
callback = MockCallback(key_docs=[bson_data("keyDocument.json")])
self.mongocrypt = MongoCrypt(opts, callback)
self.encrypter = ExplicitEncrypter(callback, opts)
Expand Down
17 changes: 13 additions & 4 deletions bindings/python/test/test_mongocrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ def test_encrypt_encrypted_fields_map(self):
encrypted_fields_map = bson_data(
"compact/success/encrypted-field-config-map.json"
)
mc = self.create_mongocrypt(encrypted_fields_map=encrypted_fields_map, enable_range_v2=True)
mc = self.create_mongocrypt(
encrypted_fields_map=encrypted_fields_map, enable_range_v2=True
)
self.addCleanup(mc.close)
with mc.encryption_context("db", bson_data("compact/success/cmd.json")) as ctx:
self.assertEqual(ctx.state, lib.MONGOCRYPT_CTX_NEED_MONGO_KEYS)
Expand Down Expand Up @@ -1002,7 +1004,9 @@ async def test_range_query_int32(self):
is_expression=True,
)
encrypted_val = bson.decode(encrypted, OPTS)
self.assertEqual(encrypted_val, adjust_range_counter(encrypted_val, expected))
self.assertEqual(
encrypted_val, adjust_range_counter(encrypted_val, expected)
)


class TestNeedKMSAzureCredentials(unittest.TestCase):
Expand Down Expand Up @@ -1179,13 +1183,18 @@ def adjust_range_counter(encrypted_val, expected):
_decoded2 = bson.decode(_payload2[1:])
for _ in range(10):
_decoded1["payloadId"] += 1
expected["v"]["$and"][0]["age"]["$gte"] = Binary(_payload1[0:1]+bson.encode(_decoded1), 6)
expected["v"]["$and"][0]["age"]["$gte"] = Binary(
_payload1[0:1] + bson.encode(_decoded1), 6
)
_decoded2["payloadId"] += 1
expected["v"]["$and"][1]["age"]["$lte"] = Binary(_payload2[0:1]+bson.encode(_decoded2), 6)
expected["v"]["$and"][1]["age"]["$lte"] = Binary(
_payload2[0:1] + bson.encode(_decoded2), 6
)
if encrypted_val == expected:
break
return expected


class AsyncKeyVaultCallback(MockAsyncCallback):
def __init__(self, kms_reply=None):
super().__init__(kms_reply=kms_reply)
Expand Down

0 comments on commit c337f39

Please sign in to comment.