Skip to content

Commit 1de3068

Browse files
committed
Run recent version of black against code
1 parent c1221b4 commit 1de3068

4 files changed

Lines changed: 35 additions & 8 deletions

File tree

minfraud/validation.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,10 @@ def _uri(s: str) -> str:
273273

274274
validate_transaction = Schema(
275275
{
276-
"account": {"user_id": str, "username_md5": _md5,},
276+
"account": {
277+
"user_id": str,
278+
"username_md5": _md5,
279+
},
277280
"billing": _address,
278281
"payment": {
279282
"processor": _payment_processor,
@@ -298,7 +301,10 @@ def _uri(s: str) -> str:
298301
"session_id": str,
299302
"user_agent": str,
300303
},
301-
"email": {"address": _email_or_md5, "domain": _hostname,},
304+
"email": {
305+
"address": _email_or_md5,
306+
"domain": _hostname,
307+
},
302308
"event": {
303309
"shop_id": str,
304310
"time": _rfc3339_datetime,

minfraud/webservice.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,15 @@
2929
from .validation import validate_report, validate_transaction
3030

3131

32-
_AIOHTTP_UA = "minFraud-API/%s %s" % (__version__, aiohttp.http.SERVER_SOFTWARE,)
32+
_AIOHTTP_UA = "minFraud-API/%s %s" % (
33+
__version__,
34+
aiohttp.http.SERVER_SOFTWARE,
35+
)
3336

34-
_REQUEST_UA = "minFraud-API/%s %s" % (__version__, requests.utils.default_user_agent(),)
37+
_REQUEST_UA = "minFraud-API/%s %s" % (
38+
__version__,
39+
requests.utils.default_user_agent(),
40+
)
3541

3642

3743
# pylint: disable=too-many-instance-attributes, missing-class-docstring

tests/test_models.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ def test_email(self):
123123

124124
def test_email_domain(self):
125125
first_seen = "2016-01-01"
126-
domain = EmailDomain({"first_seen": first_seen,})
126+
domain = EmailDomain(
127+
{
128+
"first_seen": first_seen,
129+
}
130+
)
127131

128132
self.assertEqual(first_seen, domain.first_seen)
129133

@@ -142,8 +146,13 @@ def test_ip_address(self):
142146
time = "2015-04-19T12:59:23-01:00"
143147
address = IPAddress(
144148
{
145-
"country": {"is_high_risk": True, "is_in_european_union": True,},
146-
"location": {"local_time": time,},
149+
"country": {
150+
"is_high_risk": True,
151+
"is_in_european_union": True,
152+
},
153+
"location": {
154+
"local_time": time,
155+
},
147156
"risk": 99,
148157
"traits": {
149158
"is_anonymous": True,

tests/test_webservice.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,13 @@ def test_200_on_request_with_nones(self):
202202
request={
203203
"device": {"ip_address": "81.2.69.160", "accept_language": None},
204204
"event": {"shop_id": None},
205-
"shopping_cart": [{"category": None, "quantity": 2,}, None],
205+
"shopping_cart": [
206+
{
207+
"category": None,
208+
"quantity": 2,
209+
},
210+
None,
211+
],
206212
}
207213
)
208214
response = self.response

0 commit comments

Comments
 (0)