julien-duponchelle/python-mysql-replication

Fix TestCode Using Constant instead String

sean-k1 opened this issue · 2 comments

Comparing through constants is better than comparing strings directly

https://github.com/julien-duponchelle/python-mysql-replication/blob/c639f4714956816e3f9b529596e2268caef8daac/pymysqlreplication/tests/test_basic.py#L1793C3-L1793C3

"null" -> NONE_SOURCE.NULL

if before_none_sources:
self.assertEqual(before_none_sources["col0"], "null")
self.assertEqual(before_none_sources["col1"], "null")
self.assertEqual(before_none_sources["col2"], "out of datetime2 range")
self.assertEqual(before_none_sources["col3"], "null")
self.assertEqual(before_none_sources["col4"], "null")
if after_none_sources:
self.assertEqual(after_none_sources["col0"], "null")
self.assertEqual(after_none_sources["col1"], "null")
self.assertEqual(after_none_sources["col2"], "null")
self.assertEqual(after_none_sources["col3"], "out of date range")
self.assertEqual(after_none_sources["col4"], "empty set")

"null" -> NONE_SOURCE.NULL
"out of datetime2 range" -> NONE_SOURCE.OUT_OF_DATETIME2_RANGE
"out of datetime range" -> NONE_SOURCE.OUT_OF_DATETIME_RANGE

Hello, can I work on that?

@sotiriszogos sure thanks!