From 80a04c4eaafec8d33819d1f2991bbda5b1de148a Mon Sep 17 00:00:00 2001 From: Ethan Ho <53266718+ethho@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:00:54 -0500 Subject: [PATCH] Migrate tests from #1091 to pytest --- tests/test_blob_matlab.py | 2 +- tests/test_declare.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/test_blob_matlab.py b/tests/test_blob_matlab.py index 8e467cf0..17a6ac65 100644 --- a/tests/test_blob_matlab.py +++ b/tests/test_blob_matlab.py @@ -34,7 +34,7 @@ def insert_blobs(schema): schema.connection.query( """ - INSERT INTO {table_name} VALUES + INSERT INTO {table_name} (`id`, `comment`, `blob`) VALUES (1,'simple string',0x6D596D00410200000000000000010000000000000010000000000000000400000000000000630068006100720061006300740065007200200073007400720069006E006700), (2,'1D vector',0x6D596D0041020000000000000001000000000000000C000000000000000600000000000000000000000000F03F00000000000030400000000000003F4000000000000047400000000000804E4000000000000053400000000000C056400000000000805A400000000000405E4000000000000061400000000000E062400000000000C06440), (3,'string array',0x6D596D00430200000000000000010000000000000002000000000000002F0000000000000041020000000000000001000000000000000700000000000000040000000000000073007400720069006E00670031002F0000000000000041020000000000000001000000000000000700000000000000040000000000000073007400720069006E0067003200), diff --git a/tests/test_declare.py b/tests/test_declare.py index 8939000b..d711da4b 100644 --- a/tests/test_declare.py +++ b/tests/test_declare.py @@ -360,3 +360,18 @@ class Table_With_Underscores(dj.Manual): dj.DataJointError, match="must be alphanumeric in CamelCase" ) as e: schema_any(Table_With_Underscores) + + +def test_hidden_attributes(schema_any): + assert ( + list(Experiment().heading._attributes.keys())[-1].split("_")[2] + == "timestamp" + ) + assert ( + len([a for a in Experiment().heading._attributes.values() if a.is_hidden]) + != 0 + ) + assert ( + len([a for a in Experiment().heading.attributes.values() if a.is_hidden]) + == 0 + )