diff --git a/tests/_fixtures.py b/tests/_fixtures.py index 7bf55ee232..0bd8fe163a 100644 --- a/tests/_fixtures.py +++ b/tests/_fixtures.py @@ -130,13 +130,23 @@ CREATE TABLE all_types ( pkey BIGINT NOT NULL, int_value INT, + int_array INT[], bool_value BOOL, + bool_array BOOL[], bytes_value BYTEA, + bytes_array BYTEA[], float_value DOUBLE PRECISION, + float_array DOUBLE PRECISION[], string_value VARCHAR(16), + string_array VARCHAR(16)[], + date_value DATE, + date_array DATE[], timestamp_value TIMESTAMPTZ, + timestamp_array TIMESTAMPTZ[], numeric_value NUMERIC, + numeric_array NUMERIC[], jsonb_value JSONB, + jsonb_array JSONB[], PRIMARY KEY (pkey) ); CREATE TABLE counters ( name VARCHAR(1024), diff --git a/tests/system/test_session_api.py b/tests/system/test_session_api.py index c9c5c8a959..9e91bea535 100644 --- a/tests/system/test_session_api.py +++ b/tests/system/test_session_api.py @@ -85,11 +85,9 @@ EMULATOR_ALL_TYPES_COLUMNS = LIVE_ALL_TYPES_COLUMNS[:-4] # ToDo: Clean up generation of POSTGRES_ALL_TYPES_COLUMNS -POSTGRES_ALL_TYPES_COLUMNS = ( - LIVE_ALL_TYPES_COLUMNS[:1] - + LIVE_ALL_TYPES_COLUMNS[1:7:2] - + LIVE_ALL_TYPES_COLUMNS[9:17:2] - + ("jsonb_value",) +POSTGRES_ALL_TYPES_COLUMNS = LIVE_ALL_TYPES_COLUMNS[:17] + ( + "jsonb_value", + "jsonb_array", ) AllTypesRowData = collections.namedtuple("AllTypesRowData", LIVE_ALL_TYPES_COLUMNS) @@ -180,12 +178,33 @@ PostGresAllTypesRowData(pkey=101, int_value=123), PostGresAllTypesRowData(pkey=102, bool_value=False), PostGresAllTypesRowData(pkey=103, bytes_value=BYTES_1), + PostGresAllTypesRowData(pkey=104, date_value=SOME_DATE), PostGresAllTypesRowData(pkey=105, float_value=1.4142136), PostGresAllTypesRowData(pkey=106, string_value="VALUE"), PostGresAllTypesRowData(pkey=107, timestamp_value=SOME_TIME), PostGresAllTypesRowData(pkey=108, timestamp_value=NANO_TIME), PostGresAllTypesRowData(pkey=109, numeric_value=NUMERIC_1), PostGresAllTypesRowData(pkey=110, jsonb_value=JSON_1), + # empty array values + PostGresAllTypesRowData(pkey=201, int_array=[]), + PostGresAllTypesRowData(pkey=202, bool_array=[]), + PostGresAllTypesRowData(pkey=203, bytes_array=[]), + PostGresAllTypesRowData(pkey=204, date_array=[]), + PostGresAllTypesRowData(pkey=205, float_array=[]), + PostGresAllTypesRowData(pkey=206, string_array=[]), + PostGresAllTypesRowData(pkey=207, timestamp_array=[]), + PostGresAllTypesRowData(pkey=208, numeric_array=[]), + PostGresAllTypesRowData(pkey=209, jsonb_array=[]), + # non-empty array values, including nulls + PostGresAllTypesRowData(pkey=301, int_array=[123, 456, None]), + PostGresAllTypesRowData(pkey=302, bool_array=[True, False, None]), + PostGresAllTypesRowData(pkey=303, bytes_array=[BYTES_1, BYTES_2, None]), + PostGresAllTypesRowData(pkey=304, date_array=[SOME_DATE, None]), + PostGresAllTypesRowData(pkey=305, float_array=[3.1415926, 2.71828, None]), + PostGresAllTypesRowData(pkey=306, string_array=["One", "Two", None]), + PostGresAllTypesRowData(pkey=307, timestamp_array=[SOME_TIME, NANO_TIME, None]), + PostGresAllTypesRowData(pkey=308, numeric_array=[NUMERIC_1, NUMERIC_2, None]), + PostGresAllTypesRowData(pkey=309, jsonb_array=[JSON_1, JSON_2, None]), ) if _helpers.USE_EMULATOR: