Skip to content

Commit 2511ae6

Browse files
committed
fix formatted by black
1 parent 7b02034 commit 2511ae6

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

pymysqlreplication/event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ def to_dict(self) -> dict:
8888
"event_size": self.event_size,
8989
"read_bytes": self.packet.read_bytes,
9090
}
91-
91+
9292
def to_json(self) -> str:
9393
return json.dumps(self.to_dict())
94-
94+
9595
def _dump(self):
9696
"""Core data dumped for the event"""
9797
pass
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from pymysqlreplication.tests.base import PyMySQLReplicationTestCase
2-
from pymysqlreplication import BinLogStreamReader
2+
from pymysqlreplication import BinLogStreamReader
33
import json
4-
class BinLogEventTestCase(PyMySQLReplicationTestCase):
54

5+
6+
class BinLogEventTestCase(PyMySQLReplicationTestCase):
67
def setUp(self):
78
super(BinLogEventTestCase, self).setUp()
89
self.execute("SET SESSION binlog_rows_query_log_events=1")
@@ -11,25 +12,20 @@ def tearDown(self):
1112
self.execute("SET SESSION binlog_rows_query_log_events=0")
1213
super(BinLogEventTestCase, self).tearDown()
1314

14-
target_fields = [
15-
"timestamp",
16-
"log_pos",
17-
"event_size",
18-
"read_bytes"
19-
]
15+
target_fields = ["timestamp", "log_pos", "event_size", "read_bytes"]
2016

2117
def test_to_dict(self):
2218
self.stream = BinLogStreamReader(self.database, server_id=1024)
2319
query = "CREATE TABLE test (id INT NOT NULL AUTO_INCREMENT, data VARCHAR (50) NOT NULL, PRIMARY KEY (id))"
2420
self.execute(query)
25-
self.execute("COMMIT")
21+
self.execute("COMMIT")
2622

2723
event = self.stream.fetchone()
2824

2925
event_dict = event.to_dict()
30-
26+
3127
self.assertEqual(set(event_dict.keys()), set(self.target_fields))
32-
self.assertEqual(event_dict["timestamp"], event.formatted_timestamp)
28+
self.assertEqual(event_dict["timestamp"], event.formatted_timestamp)
3329
self.assertEqual(event_dict["log_pos"], event.packet.log_pos)
3430
self.assertEqual(event_dict["read_bytes"], event.packet.read_bytes)
3531
self.assertEqual(event_dict["event_size"], event.event_size)
@@ -38,9 +34,8 @@ def test_to_json(self):
3834
self.stream = BinLogStreamReader(self.database, server_id=1024)
3935
query = "CREATE TABLE test (id INT NOT NULL AUTO_INCREMENT, data VARCHAR (50) NOT NULL, PRIMARY KEY (id))"
4036
self.execute(query)
41-
self.execute("COMMIT")
37+
self.execute("COMMIT")
4238

4339
event = self.stream.fetchone()
4440

4541
assert event.to_json() == json.dumps(event.to_dict())
46-

0 commit comments

Comments
 (0)