From abb6ea18c1512cac4a0a23be47c185f481ad0d9b Mon Sep 17 00:00:00 2001 From: Haleemur Ali Date: Tue, 19 Jul 2022 21:44:51 -0400 Subject: [PATCH] add test_blob and fix environ keyerror --- tests/integration/test_tap_mysql.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/integration/test_tap_mysql.py b/tests/integration/test_tap_mysql.py index 0af047d..ce032df 100644 --- a/tests/integration/test_tap_mysql.py +++ b/tests/integration/test_tap_mysql.py @@ -335,6 +335,16 @@ def test_geometrycollection(self): 'sql-datatype': 'geometrycollection', 'datatype': 'geometrycollection'}) + def test_blob(self): + actual = self.schema.properties['c_blob'] + self.assertEqual(actual, + Schema(['null', 'string'], + format='binary', + inclusion='available')) + self.assertEqual(self.get_metadata_for_column('c_blob'), + {'selected-by-default': True, + 'sql-datatype': 'blob', + 'datatype': 'blob'}) class TestSelectsAppropriateColumns(unittest.TestCase): @@ -715,10 +725,10 @@ def setUp(self): cursor.execute('CREATE TABLE binlog_1 (id int, updated datetime, ' 'created_date Date)') cursor.execute(""" - CREATE TABLE binlog_2 (id int, - updated datetime, - is_good bool default False, - ctime time, + CREATE TABLE binlog_2 (id int, + updated datetime, + is_good bool default False, + ctime time, cjson json) """) cursor.execute( @@ -1012,7 +1022,7 @@ def test_binlog_stream_with_gtid(self): global SINGER_MESSAGES engine = os.getenv('TAP_MYSQL_ENGINE', MYSQL_ENGINE) - gtid = binlog.fetch_current_gtid_pos(self.conn, os.environ['TAP_MYSQL_ENGINE']) + gtid = binlog.fetch_current_gtid_pos(self.conn, engine) config = test_utils.get_db_config() config['use_gtid'] = True